4

Probably related to How can I use an http proxy with node.js http.Client?

I've read this post, and tried it here. https://gist.github.com/lessmind/5704519

the request function sends a request to specify url, print the request options and page body, when it got a proxy param, it'll parse it and set into the request options as this post said.

But when I tried it on http://showip.net/, the returned ip are the same with proxy or not.

Did I make anything wrong? Or any other way to send a request via proxy?

1 Answer 1

3

According to http://nodejs.org/api/http.html#http_http_request_options_callback

hostname: To support url.parse() hostname is preferred over host

Should add this line when overwriting proxy informations.

options.hostname = proxy.hostname;
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.