问题
I can make a request through a corporate proxy with authentication using c# and httpWebrequest. I could then get the proxy and port used.
Then I tried to use it with curl, wget and rebol and all failed.
For example after creating environment variable http-proxy containing proxy ip and port, I type this command in cmd prompt:
curl --proxy-user login:password google.com
it answers
(6) could not resolve host:google.com
For what reason does http request works for c# and not for others ?
回答1:
Have you tried syntax similar to:
curl -U user:passwd -x proxy:port http://www.stackoverflow.com/
回答2:
The environment variable for a http proxy should be 'http_proxy' (minus the quotes). Note the lower case letters and underscore.
来源:https://stackoverflow.com/questions/6428182/c-sharp-httpwebrequest-with-proxy-works-but-not-curl