socketry / async-http

MIT License
298 stars 45 forks source link

Username and password proxy support #46

Closed jonnynux closed 4 years ago

jonnynux commented 4 years ago

It can be useful to implement support for proxies that need authentication.

ioquatix commented 4 years ago

Do you mean the proxy-authenticate header?

jonnynux commented 4 years ago

We use a proxy with NTLM authentication, setting the proper headers is enough?

ioquatix commented 4 years ago

It should be!

jonnynux commented 4 years ago

Please, can you add in the readme how to send requests through a proxy? For example I want to make multiple async requests for some URLs through a proxy "proxy.local" port 8080.

ioquatix commented 4 years ago

I will add an example, in the mean time you can refer to the specs: https://github.com/socketry/async-http/blob/master/spec/async/http/proxy_spec.rb

crondaemon commented 4 years ago

The proxy authentication using NTLM is much more than a straight header authentication:

https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-grvhenc/b9e676e7-e787-4020-9840-7cfe7c76044a

It needs to get a challenge from the proxy, reply with a response (now with a header), then move on. The question is: does your software support NTLM proxy auth, or should we implement it ourselves then pass the authentication header to the Proxy object? Thanks.

ioquatix commented 4 years ago

Nope, async-http doesn't support NTLM proxy authentication. If this is a commercial project, I am happy to provide consulting services to implement this feature.

jonnynux commented 4 years ago

We found another gem, more suitable for our purpose, I close the issue.

ioquatix commented 4 years ago

What gem are you using that supports NTLM proxy authentication?

crondaemon commented 4 years ago

There are many gems that support it. We've evidence that RestClient supports it and I am inclined to think that httparty supports it as well. But to have async requests with NTLM proxy auth we're trying em-http-request.

ioquatix commented 4 years ago

Good luck with EventMachine. Last time I tried it, it core dumped when using IPv6.