Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/backendstack21/rproxy
HTTP reverse proxy implementation based on Node.js and Docker
https://github.com/backendstack21/rproxy
api-gateway docker fast-gateway http proxy reverse-proxy
Last synced: about 2 months ago
JSON representation
HTTP reverse proxy implementation based on Node.js and Docker
- Host: GitHub
- URL: https://github.com/backendstack21/rproxy
- Owner: BackendStack21
- License: mit
- Created: 2021-11-12T07:29:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T19:21:03.000Z (7 months ago)
- Last Synced: 2024-05-22T20:28:23.091Z (7 months ago)
- Topics: api-gateway, docker, fast-gateway, http, proxy, reverse-proxy
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# rproxy
[![build images](https://github.com/BackendStack21/rproxy/actions/workflows/build_images.yaml/badge.svg)](https://github.com/BackendStack21/rproxy/actions/workflows/build_images.yaml)
HTTP reverse proxy implementation based on Node.js and Docker.
`rproxy` is based on `fast-gateway` and is a ready to use Docker container image for implementing reverse proxies or API Gateways.
> See: https://github.com/BackendStack21/fast-gateway## Usage
### config.js
```js
module.exports = {middlewares: [
require('cors')()
],routes: [{
prefix: '/api',
target: 'https://httpbin.org'
}, {
proxyType: 'websocket',
prefix: '/echo',
target: 'ws://ws.ifelse.io'
}]}
```### Running locally using Docker
```bash
docker run --rm -p 8080:8080 -v $(pwd)/config.js:/rproxy/src/config.js kyberneees/rproxy:latest
```### Dockerfile
```Dockerfile
FROM kyberneees/rproxy:latest
COPY config.js ./src
```## Configuration
### Environment values
- `PORT`: Indicates the running port of the HTTP server. Defaults to: `8080`### Installing custom NPM modules
In order to use custom NPM modules, those have to be installed through your `Dockerfile`. For example:```Dockerfile
FROM kyberneees/rproxy:latestRUN npm i morgan
```Modules installed by default:
- cors: https://www.npmjs.com/package/cors
- http-cache-middleware: https://www.npmjs.com/package/http-cache-middleware