Open ramsayleung opened 4 years ago
It's hard to know if it's proxy related without knowing the proxy settings or the logs. So far, it just looks like the server terminated the request upon connect.
Hello Sean,
I'm using CNTLM (a local proxy server) which connects to our corporate proxy which uses NTLM authentication. This normally works just fine, you just set the environment variables http_proxy
and https_proxy
to https://127.0.0.1:<port>
and this makes basically any app NTLM aware. In the case of ncspot however, there is this issue I can't get rid of and I expect there is an issue in reqwest that prevent this from working properly.
As you can see, some network operations work just fine, like receiving an access token, so I would exclude the possibility of a network issue.
See the debug output for further information. Let me know if you need more details.
reqwest doesn't support NTLM yet, see https://github.com/seanmonstar/reqwest/issues/498
Yes, but with CNTLM no app has to support NTML. CNTML is a local http proxy which translates all traffic to NTML. Like this you can make all apps NTML capable. It works just fine (normally).
Those logs look old... What version of reqwest are you using?
Reqwest seems to be a sub-dependency of ncspot. The versions used are 0.10.1 and 0.9.24
I can't say whether the new version of reqwest (0.10.x) has fixed it, but it has seen some adjustments to the way proxies are used. Can you upgrade?
I'm going to close this as out-of-date. If updating still shows a problem, we can re-open!
The thing iis , I don't know how to build ncspot with a current version of reqwest since it's a sub-dependency... Do you have an idea?
Hello @seanmonstar The issue persists with the newest version of reqwest
Can you provide trace logs again?
It seems I did it wrong the first time. Now I figured out how to utilize the newest version of 'reqwest'. Unfortunately the app doesn't compile anymore. It appears that the get() function changed fundamentally between 0.9.24 and 0.10.4 and changed the returned type. I would have to modify a lot of code of 'ncspot' to make it compatible, just for this test. I guess I would have to ask the developer of 'ncspot' to upgrade to reqwest 0.10? Is there any other way we could test this?
What I actually don't get: 'ncspot' uses an old version of reqwest, but the Authentication works fine with the proxy. However, 'rspotify' uses the current version of 'reqwest'. According to the dev of 'ncspot' the app fails because of 'rspotify'. This leads me to believe that maybe we're facing a regression. It worked fine with 0.9.24 and stopped working with 0.10.4?
It appears that the get() function changed fundamentally between 0.9.24 and 0.10
Yes, but it's easy to fix. The default API is now async, and if the blocking
feature is enabled in the Cargo.toml
, you can use reqwest::blocking::get
.
As for a regression, if so we should fix it! But I'm curious about something. In 0.9.x, reqwest didn't have automatic support for system proxies, and 0.10 does (on Unix, it looks for environment variables like curl, and on Windows it looks in the system registry). How were you configuring the proxy for 0.9?
After your hint to use blocking, I managed to build the application, thanks!
As for the proxy support, I'm on Windows and set the environment variables. Where in the registry does reqwest look?
I'm on Windows and set the environment variables. Where in the registry does reqwest look?
Woops, correction: even on Windows, it checks for the http_proxy
and https_proxy
environment variables, and if nothing is found, it looks in the registry.
So in the logs, nothing stands out to me. Though, I've thought of this possible change: in 0.9, there was a default user-agent, and in 0.10, there is not. Could the proxy be requiring a user-agent?
Okay, then everything should work. These environment variables are set and work fine otherwise. The user-agent is a possible lead. However, in the CNTLM manual I don't see any information about a mandatory user-agent. Is there an easy way to revert this change and see if it makes a difference?
Hi Sean, @frejion was using ncspot with proxy which depends on
rspotify
, andrspotify
depends onreqwest
, and rspotify fails to connect through proxy.This came up in this issue (for reference): https://github.com/ramsayleung/rspotify/issues/83
I think perhaps it's something related with
reqwest
as well, this is therspotify
code which sends request byreqwest
:this is the backtrace from @frejion :
I am not sure whether it does has something to do with
reqwest
?