Hi everyone,
I'm new on nodejs and start trying to setup multiple domains on my litle server, (the http is all setup and working), but when i try http-proxy solution they return:
root@NodeCass:/dados# nodejs server.js
/dados/node_modules/http-proxy/lib/http-proxy/index.js:119
throw err;
^
Error: Must provide a proper URL as target
at ProxyServer.<anonymous> (/dados/node_modules/http-proxy/lib/http-proxy/index.js:68:35)
at Server.closure (/dados/node_modules/http-proxy/lib/http-proxy/index.js:125:43)
at Server.EventEmitter.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2108:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
at Socket.socket.ondata (http.js:1966:22)
at TCP.onread (net.js:525:27)
The error message only appears on console when i try to access the http on listened port, my last try was:
var http = require('http')
, httpProxy = require('http-proxy');
httpProxy.createServer({
hostnameOnly: true,
router: {
}
}).listen(80);
i've change my host file to this domain access this server, and works fine when i try to access it directly, like:
http://ogenial.com.br:3001 but http-proxy keep saying its not a proper URL.
Thank in advance.
Att,
Lucas Schirm