# reverse-proxy-node

> NodeJS reverse proxy

Latest version **1.0.3** (published 2024-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install reverse-proxy-node
pnpm add reverse-proxy-node
yarn add reverse-proxy-node
bun add reverse-proxy-node
```

Provides the command `reverse-proxy`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2024-04-09 |
| First published | 2023-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | SoundOfTheSky |
| Maintainers | softsky |
| Keywords | CLI, Proxy, Reverse Proxy |

## Links

- npm: https://www.npmjs.com/package/reverse-proxy-node
- Repository: https://github.com/SoundOfTheSky/reverse-proxy
- Homepage: https://github.com/SoundOfTheSky/reverse-proxy#readme
- Issues: https://github.com/SoundOfTheSky/reverse-proxy/issues
- npm.io page: https://npm.io/package/reverse-proxy-node

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2024-04-09
- 1.0.2 — 2023-01-23
- 1.0.1 — 2023-01-17
- 1.0.0 — 2023-01-17

## README

# Reverse Proxy Node

>Reverse proxy CLI tool written in JavaScript with RegExp mapping


#### Install:
`npm install -g reverse-proxy-node`

#### Example of usage:
```
reverse-proxy 
    /\.(jpg|png)$/=cdn.com   | Every .png and .jpg is served from cdn.com
    /^/api/=192.168.1.100:8080 | /api => 192.168.1.100:8080
    /^//=:5173                 | Everything else => localhost:5173
    --key privkey.pem 
    --ca chain.pem 
    --cert cert.pem
    --port 443
```

#### Programmatic usage:
```
import RevProxy from 'reverse-proxy-node';
// OR
const RevProxy = require('reverse-proxy-node');

RevProxy({
	port: 443,
	key: 'privkey.pem',
	ca: 'chain.pem',
	cert: 'cert.pem',
	rules: {
	    '/\.(jpg)|(png)$/': {
	        address: 'cdn.com',
	    },
		'/^/api/': {
			port: 8080,
		},
		'/^//': {
			port: 5173,
		},
	},
});
```

#### Options:
- port: <number> | --port <number> | -p <number> **Default: 443 or 80** based on cert
- key: <path> | --key <path>
- cert: <path> | --cert <path>
- ca: <path> | --ca <path>
- serverOpts: net.ServerOpts [Only programmatic usage]
- rules:
```
CLI: /RegExp/=address:port OR /RegExp/=address OR /RegExp/=:port

Programmatic: {
    '/RegExp/': {
        address: 'URL',  // Default 127.0.0.1
        port: <number>   // Default 443 or 80
    }
}
```

---
_Source: https://npm.io/package/reverse-proxy-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
