On Sep 27, 2015, at 4:55 PM, Lucas Schirm wrote:
> 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: {
> 'ogenial.com.br': '104.236.197.167:3001'
> }
> }).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.
The way you're trying to use http-proxy does not look like any of the ways
described in their documentation:
https://www.npmjs.com/package/http-proxy
Have you tried to do it the way they show on that page?
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/9B952601-6693-4D56-9E4D-1244A9780AE1%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.