live-server
live-server copied to clipboard
How to use proxy is not clear & throws error
Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting
Issue description
Trying to add proxy to command line fails. Throws:
Error: connect ECONNREFUSED 127.0.0.1:80
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
Would like to do something like --proxy=:.html also but can't figure out how to do that.
Software details
-
Command line used for launching
live-server
:live-server --port=8999 --no-browser --proxy=/who-we-are:/who-we-are.html
-
OS:
OSX
-
Browser (if browser related):
Chrome
-
Node.js version:
v8.9.1
-
live-server
version:1.2.0
Edit: also is there a way to support ejs
or some other templating tool?
How to use proxy for node usage?
How to use proxy for node usage?
In case anyone is wondering 4 years later, this is the syntax to add to node server params:
proxy: [["/api/", "http://localhost:5000"]]