Hey,

This realy help me, the real problem was im trying to put http and
httpProxy in diferent instances of nodejs, i thing he was able do listen
the door on server and detect it open an responding, but to work, the
httpProxy and http need to be start on same instance.

Thanks alot, and have a nice day, in future i will look at this site, great
documentation, the GitHub was not so good as reference.

have a nice day!!!!

2015-09-28 1:37 GMT-03:00 Ryan Schmidt <google-2...@ryandesign.com>:

>
> 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 nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> 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.
>

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAFzVQVxNi09J55YhUx1USPoHaAr4w9ogNA5H6GFx6nO797qP%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to