A proxy building helper with subdomain support.
npm install -g procsy
procsy -t http://google.com
Subdomain proxying in the localhost requires you configure the
hosts
file properly.
To proxy subdomain based requests, you can specify source subdomains and their targets in the following syntax:
[subdomain],[target]
/etc/hosts
:127.0.0.1 app.dev api.app.dev
procsy -t api,http://my-external-api.com
from | to |
---|---|
http://api.local.dev/path |
http://my-external-api.com/path |
http://local.dev/path |
404 |
/etc/hosts
:127.0.0.1 app.dev api.app.dev tracking.app.dev
procsy -t api,http://my-external-api.com tracking,http://analytics.com
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 |
/etc/hosts
:127.0.0.1 app.dev api.app.dev
procsy -t api,http://my-external-api.com *,http://my-app.com
from | to |
---|---|
http://api.local.dev/path |
http://my-external-api.com/path |
http://local.dev/path |
http://my-app.com/path |