0

I'm using node package http-server to serve my web pages locally. Suddenly it started failing to connect to the proxy server. Searched in stackoverflow but didn't get satisfied answer for this scenario. Please help.

Here are the commands and logs:

http-server -p 8000 app/ --proxy localhost:3000 Starting up http-server, serving app/ Available on: http:127.0.0.1:8000 http:192.168.1.6:8000 Unhandled requests will be served from: localhost:3000 Hit CTRL-C to stop the server

[Mon, 04 Jul 2016 13:29:27 GMT] "POST /candidates/resumes" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" /Users/tushar/.node_modules_global/lib/node_modules/http-server/node_modules/http-proxy/lib/http-proxy/index.js:119 throw err; ^

Error: connect EHOSTUNREACH 0.0.11.184:80 - Local (192.168.1.6:58636) at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at connect (net.js:843:14) at net.js:985:7 at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)

1 Answer 1

0

Found the issue. My bad. The proxy address has to be inside the quotation mark. No idea when it has become mandatory to be quoted. Here is the example command if it helps anyone -

http-server app/ -p 8000 --proxy 'http://localhost:3000'

or simply the following (default port and current-dir instead of specifying a folder 'app')

http-server --proxy 'http://localhost:3000'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.