Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shirshendubhowmick/reverse-proxy
NodeJS based reverse proxy server
https://github.com/shirshendubhowmick/reverse-proxy
Last synced: 18 days ago
JSON representation
NodeJS based reverse proxy server
- Host: GitHub
- URL: https://github.com/shirshendubhowmick/reverse-proxy
- Owner: shirshendubhowmick
- Created: 2019-12-07T14:03:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T15:31:18.000Z (about 2 years ago)
- Last Synced: 2024-12-20T11:40:16.845Z (26 days ago)
- Language: JavaScript
- Size: 569 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple NodeJS based reverse proxy
**Backend**
To start the proxy server:
```
cd backend
npm install
npm run dev
```This starts the server at `localhost:8085`
The server has got two end points:
`PATCH /config`
This end point used to configure origin & destination mapping, example
```JSON
{ "www.abc.com": "www.xyz.com"}
````This will proxy all request originating from `www.abc.com` to `www.xyz.com`
`ALL /proxy`
This endpoint acts as proxy endpoint, all request to this endpoint is proxied. As per the available origin destination mapping.
If a particular origin is not registered, server responds with status `400` and body
```JSON
{
"error": "Origin not registered"
}
```
Incase the destination server is unreachable server responds with `500` and body
```JSON
{
"error": "Unbale to reach destination server"
}
```**Frontend**
To start the frontend server:
```
cd frontend
npm install
npm start
```
This will start the frontend local server. The frontend uses `/config` endpoint to configure origin & destination mapping.