-
Notifications
You must be signed in to change notification settings - Fork 2k
Keep Alive (NTLM) #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any chance that node-http-proxy will support more than one request on a single connection in the future? I don't know if it is wrong to bring up nodejitsu related stuff here, but after speaking with nuno on IRC, he told me to continue my questions here :) Thanks. |
Is your issue really with the keepalive or is it the https handshake performance? I thought you were doing some advanced https1.1 stuff, but if its related to the handshake we actually would need to take different steps. Anyway thanks for bumping up this, also do you remember the pull request that was related to this? |
Our issue is with keepalive. About handshake performance i don't think it is relavent since the problem is worst if latency is High which it often is on Mobile connections (and our api is used mainly by iphone users). Then improving the handshake wouldn't do anything about the trips back and forth. It would be solved if note-http-proxy did persistent connections between proxy and client. I don't think there's an urgent need to implement it between server and proxy, since there's almost no latency and no handshake? Correct? I'll see if I can find the pull request, when I'm back on my comp, but I think it was a smaller fix, and not an implementation for a solution. |
Sounds awesome. Thanks for clarifying. My point was that ssh performance in node is a far more understood topic. @indutny has a repo called tls-snappy that tackles it, but to the best of my knowledge nothing beats putting a tls terminal in front of node yet :( I think you saw some discussion from @mranney and @mikeal on the topic on a request issue. Not entirely sure how voxer is currently dealing with this though. |
Yeah, i've been reading through it, and found that Voxer made this module/agent that they're using: Unfortunately i don't have more time to look into this, cause we have to be ready for production within 2 weeks - so for now we will need to host our app by ourselves :( |
I'm seeing the same problem - without @terrancesnyder's patch (which I put in at https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy/http-proxy.js#L262 ) there was no prompt for username and password, but I still see a new source port number for each part of the negotiation, which means NTLM doesn't work. |
Another update after messing about some more yesterday - I substituted the default Node http agent with https://github.com/ceejbot/keep-alive-agent and that seemed to make the negotiation happen on the same connection, and it now gets as far as prompting for username and password (in Chrome). Unfortunately, it doesn't get any further than that because submitting the credentials results in another 401 and another prompt. I don't know what other effect dropping keep-alive-agent in there might be having, either... 😕 |
@GraemeF, did you actually get any further with this? I'm trying to run NTLM authentication over an HTTPS-to-HTTP reverse proxy and see similar results. I have included the abovementioned patch but would probably need a hint on how to include the keep-alive-agent you mention. Are there any other choices to proxy NTLM authenticated calls? (have tried SQUID which didn't help, contrasting to what @terrancesnyder reports above) I just need to get one single call through that doesn't even have any content, it just authenticates a user and returns a token/cookie, and subsequent requests are normal http requests that use this token/cookie for authentication... |
No I didn't, sorry. |
Thanks anyway! |
We're running node-http-proxy in front of our Web and API servers, and we critically need keep-alive. Any plan to support it in the near future? The old [email protected] used to support keep-alive. Since upgrade all connections with the client get instantly closed. |
Any updates on this? I've been testing node-http-proxy as a transparent proxy by simply running
But most of the content do not pass as connection is closed: |
Is there any sort of update as to how to fix or at least by pass this issue? I'm trying to proxy an ntlm authenticated server and running into the same issues. |
+1 |
This is something that is supported. Will move the example from #727 into the examples folder. |
I am trying to proxy content and the target server is running NTLM auth. The NTLM spec requires a certain handshake where the first 401 is sent, and the client responds.
http://www.innovation.ch/personal/ronald/ntlm.html
I've run wireshark and fiddler and I can see that the connection is NOT being re-used even though the req and res object include the required connection = 'keep-alive'.
I've attached screenshots of wireshark showing different ports being used during the multiple stages of NTLM authentication. Doing some research I got conflicting stories on if keep-alive actually does work, and if it does / does not work in node-http-proxy.
so far, running through squid-proxy, fiddler, and other proxies wireshark reports the correct re-using of the connection. The only one that does not show this is node-http-proxy (and it's also the only one that isn't able to auth the user correctly).
In addition it seems like the headers for www-authenticate are being mangled when there are multiple ones so I had to put in a patch... Without this Firefox, Chrome, IE were not prompting for NTLM authentication because there was only ONE www-authenticate header being returned rather than two separate ones.
Bad (through node-http-proxy)
As shown above you can see for each request we grab a new socket (which destroys NTLM auth and proves that it is not doing keep-alive).
Good (through fiddler, squid, etc)
The above capture shows that with a proxy running (fiddler, squid, etc) we get the re-use one would expect.
The text was updated successfully, but these errors were encountered: