1.0.0 • Published 7 years ago
procsy v1.0.0
procsy
A proxy building helper with subdomain support.
Usage
npm install -g procsy
procsy -t http://google.comSubdomains
Subdomain proxying in the localhost requires you configure the
hostsfile properly.
To proxy subdomain based requests, you can specify source subdomains and their targets in the following syntax:
[subdomain],[target]
Examples:
1. Single subdomain
hosts:
127.0.0.1 app.dev api.app.devcommand:
procsy -t api,http://my-external-api.comoutcome:
| from | to |
|---|---|
http://api.local.dev/path | http://my-external-api.com/path |
http://local.dev/path | 404 |
2. Multiple subdomains
hosts:
127.0.0.1 app.dev api.app.dev tracking.app.devcommand:
procsy -t api,http://my-external-api.com tracking,http://analytics.comoutcome:
| from | to |
|---|---|
http://api.local.dev/path | http://my-external-api.com/path |
http://tracking.local.dev/path | http://analytics.com/path |
http://local.dev/path | 404 |
3. Subdomain & domain
hosts:
127.0.0.1 app.dev api.app.devcommand:
procsy -t api,http://my-external-api.com *,http://my-app.comoutcome:
| from | to |
|---|---|
http://api.local.dev/path | http://my-external-api.com/path |
http://local.dev/path | http://my-app.com/path |
1.0.0
7 years ago