Simple proxy server, usefull to bypass cors limitations in development environments.
The quickest way to get started is to just run npx serve-from
.
You can also install it globally.
npm install -g serve-from
Once installed you can use it everywhere.
serve-from -s example.com
...will serve content from https://example.com
on https://localhost:8080
serve-from -s example.com -p 9000
... will serve content from https://example.com
on https://localhost:9000
serve-from -s example.com:7000 -p 9000
... will serve content from https://example.com:7000
on localhost:9000
serve-from -s example.com:7000 -p 9000 -h 127.0.0.1
... will serve content from https://example.com:7000
on 127.0.0.1:9000
serve-from -s example.com:7000 -p 9000 -h 127.0.0.1
... will serve content from https://example.com:7000
on 127.0.0.1:9000
printing source headers with console.log
-
-s --source
(REQUIRED) Source server without protocol. -
-p --port
(OPTIONAL) Destination port, deafult:8080
. -
-h --host
(OPTIONAL) Destination host, deafult:localhost
. -
-d --debug headers
(OPTIONAL) Debug mode for headers, deafult:false
. Prints the headers part from the source