{"id":16782730,"url":"https://github.com/andrei-straut/drp","last_synced_at":"2026-05-06T01:37:11.924Z","repository":{"id":71283098,"uuid":"92272605","full_name":"Andrei-Straut/drp","owner":"Andrei-Straut","description":"Dynamic Reverse Proxy","archived":false,"fork":false,"pushed_at":"2018-08-09T10:31:26.000Z","size":835,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T10:00:06.893Z","etag":null,"topics":["cors","java","jsonp","netty","netty-in-action","proxy","proxy-server","reverse-proxy"],"latest_commit_sha":null,"homepage":"https://www.andreistraut.info/drp/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Andrei-Straut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-24T09:07:21.000Z","updated_at":"2018-08-08T18:19:41.000Z","dependencies_parsed_at":"2023-02-27T07:45:49.038Z","dependency_job_id":null,"html_url":"https://github.com/Andrei-Straut/drp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Andrei-Straut/drp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrei-Straut%2Fdrp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrei-Straut%2Fdrp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrei-Straut%2Fdrp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrei-Straut%2Fdrp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andrei-Straut","download_url":"https://codeload.github.com/Andrei-Straut/drp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andrei-Straut%2Fdrp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014482,"owners_count":26085535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cors","java","jsonp","netty","netty-in-action","proxy","proxy-server","reverse-proxy"],"created_at":"2024-10-13T07:48:04.849Z","updated_at":"2025-10-13T09:07:55.198Z","avatar_url":"https://github.com/Andrei-Straut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/jenkins/s/https/www.andreistraut.info/jenkins/job/DRP-master.svg)](https://www.andreistraut.info/jenkins/job/DRP-master/) [![Tests](https://img.shields.io/jenkins/t/https/www.andreistraut.info/jenkins/job/DRP-master.svg)](https://www.andreistraut.info/jenkins/job/DRP-master/lastCompletedBuild/) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\n# DRP (Dynamic Reverse Proxy)\n\n## What is it?\nDRP is an application (3 actually: maven, server, and local) that proxies requests received from clients (js, browser, etc) to their server targets.  \nIt thus avoids the need for server CORS configurations (if there is even access to the server to define it), or JSONP requests. It can in fact be seen as the server-side API for any client application that uses it.  \nDRP exposes a webservice endpoint, through which you can communicate with it and issue your requests for forwarding. It supports GET and POST methods (POST with JSON format as request payload), and header forwarding.  \n\n## Why does it exist?\nIt exists because I was working on another project in which I needed to make requests from my client-side (AngularJS) to different servers, in order to gather and compile data, and I was unable to do so easily. I did not have control over all servers, and not everything was JSONP-usable, and js' eval() was not an option.  \nHence, I started creating some wrapper functions on my project's server side in order to proxy these requests, and I realized that I could extract this functionality into a different project, and thus DRP was born.\n\n## What do I need in order to install and run it?\n- drp-core: maven and java (it is meant to be used as maven dependency)\n- drp-local: java (it will  be run from console)\n- drp-web: a webserver (tomcat, glassfish, jboss, wildfly)\n\n## How do I set it up and how do I use it?\nThere's 3 options:\n### Java projects\nUse `drp-core.jar` as a dependency or in your `pom.xml`, and in the dependencies section, include the following:  \n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.andreistraut.drp\u003c/groupId\u003e\n\t\u003cartifactId\u003edrp-core\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\nCode usage would be the following:\n```java\n/** the request headers */\nMap\u003cString, String\u003e requestHeaders = ... \n\n/** the request content. Must be a valid JsonObject */\nString requestContent = ...\t\n\n/** instantiate the object that will take care of the request format translation */\nRequestTranslator translator = new RequestTranslator();\n\n/** call the translator to build the request that will be forwarded */\nHttpRequestBase proxyRequest = translator.fromJsonString(requestHeaders, requestContent);\n\n/** Dispatch the request to its final destination, and retrieve the response */\nHttpResponse response = RequestDispatcher.dispatch(proxyRequest);\n\n/** That's it! From here, just forward the response to your client-side, as you would normally do */\n```\n### Local standalone server\nRun the project from the console:  \n`drp-local-1.0-SNAPSHOT-jar-with-dependencies 8090`  \nwhere `8090` is the port number where the application will be listening. If no port number is provided, the default port is `8089`  \n  \nFrom here, you can start issuing the requests to this endpoint. It will probably be located at `http://localhost:8090/`\n\n### Running on a webserver\nDeploy the war file `drp-web-1.0-SNAPSHOT.war` to your webserver. From here, you can start issuing the requests to this endpoint. If your webserver is running on port 80, it will probably be located at `http://localhost/drp`\n\n## What can it do?\nDRP relays requests from your client to the destination endpoint. It supports:\n- GET and POST requests for the DRP endpoint\n- Forwarding of GET, POST, HEAD, OPTIONS and DELETE methods to the remote endpoint\n- For GET requests, headers are automatically forwarded to the destination. There is no request payload possible\n- For POST requests, there is more control and customization possibilities. Request payload must be a JSON object, with the following format:\n\t```json\n\t{\n\t\t\"endpoint\": \"String - the full URL of the remote endpoint (incl. port)\"\n\t\t\"method\": \"String - the HTTP method of the request to be forwarded (recommended: All-caps)\"\n\t\t\"headers\": \"JsonObject - the request headers to be forwarded (key-value)\"\n\t\t\"request\": \"JsonObject or String - the request payload to be forwarded\"\n\t}\n\t```\n\tOf these, only `endpoint` and `method` parameters are mandatory.  \n  \n\tIf headers are specified in both the JsonObject and RequestTranslator method call, the headers in JsonObject take precedence.  \n  \n\t`Request` object can take two forms: JsonObject (key-value), and in this case, the data will be translated as `application/x-www-form-urlencoded` when forwarded, or a simple `string`, which will be the payload of the forwarded request.  \n\tIf `request` parameter is present, it cannot be empty\n\n## What can't it do?\n- At the moment, DRP does not support forwarding of request payloads other than `application/text`, `text/plain`, or `application/x-www-form-urlencoded`\n- Only forwarding of GET, POST, HEAD, OPTIONS and DELETE is supported\n- No forwarding of multipart forms or files is supported\n- No type of authentication is supported\n\n## Do you take contributions / How can I contribute?\nSure. If you're interested, just get in touch, or simply send me a pull request. And thank you in advance!\n\n## What are the plans for future development?\nNone for now, or none known. DRP already does what I needed it to do, and for me that's enough. If something needs to be supported in the future, I will implement it, but future plans are pretty much undefined at this point.\n\n## Special thanks\nThe [Netty guys](https://github.com/netty/netty) for an awesome lightweight webserver.  \n[Diogo Serra](https://github.com/pdiogomserra) for ideas on how to do this","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-straut%2Fdrp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei-straut%2Fdrp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-straut%2Fdrp/lists"}