ValdikSS / tor-relay-scanner

Tor Relay availability checker, for using it as a bridge in countries with censorship
311 stars 33 forks source link

tor relay scanner doesn't work with system socks5 proxy enabled for Windows #7

Closed d3vv closed 2 years ago

d3vv commented 2 years ago

OS: Windows 11

Screenshot 2022-05-20 224920

tor-relay-scanner-0.0.7.exe -g 1 --timeout 3 --browser --start-browser
Tor Relay Scanner. Will scan up to 1 working relays (or till the end)
Downloading Tor Relay information from onionoo.torproject.org…
Can't download Tor Relay data from/via onionoo.torproject.org: HTTPSConnectionPool(host='onionoo.torproject.org', port=443): Max retries exceeded with url: /details?type=relay&running=true&fields=fingerprint,or_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Can't download Tor Relay data from/via corsbypasser.herokuapp.com: HTTPSConnectionPool(host='corsbypasser.herokuapp.com', port=443): Max retries exceeded with url: /https://onionoo.torproject.org/details?type=relay&running=true&fields=fingerprint,or_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Can't download Tor Relay data from/via corsanywhere.herokuapp.com: HTTPSConnectionPool(host='corsanywhere.herokuapp.com', port=443): Max retries exceeded with url: /https://onionoo.torproject.org/details?type=relay&running=true&fields=fingerprint,or_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Can't download Tor Relay data from/via tauron.herokuapp.com: HTTPSConnectionPool(host='tauron.herokuapp.com', port=443): Max retries exceeded with url: /https://onionoo.torproject.org/details?type=relay&running=true&fields=fingerprint,or_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Can't download Tor Relay data from/via cors-anywhere2.herokuapp.com: HTTPSConnectionPool(host='cors-anywhere2.herokuapp.com', port=443): Max retries exceeded with url: /https://onionoo.torproject.org/details?type=relay&running=true&fields=fingerprint,or_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Can't download Tor Relay data from/via icors.vercel.app: HTTPSConnectionPool(host='icors.vercel.app', port=443): Max retries exceeded with url: /?https%3A//onionoo.torproject.org/details%3Ftype%3Drelay%26running%3Dtrue%26fields%3Dfingerprint%2Cor_addresses (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1114: The handshake operation timed out')))
Tor Relay information can't be downloaded!
ValdikSS commented 2 years ago

How do you configure the proxy? Just tried it on Windows 10 (not 11) by configuring Socks proxy only in "Advanced" proxy dialog in Internet Explorer, and Tor Relay Scanner doesn't use it automatically. Works fine with --proxy option.

d3vv commented 2 years ago

For example:

proxy

I have tried the following software for 192.168.1.7 (Linux):

  1. 3proxy [ https://3proxy.ru/ ]
  2. dante [ https://www.inet.no/dante/ ]

And it works for browsers and various software as well.

Also I have tried local socks5 service (at 127.0.0.1:1080) as a client for shadowsocks external server [ https://shadowsocks.org/en/ ] All software works fine with it except tor-relay-scanner..

ValdikSS commented 2 years ago

The dialog on your screenshot is for HTTP proxy configuration (HTTP/CONNECT protocol). It does not support SOCKS. Just tried to configure proxy in this dialog on Windows 10 with 3proxy socks on the server side and sure enough it did not work in any browser, because 3proxy expects SOCKS, not HTTP. It could be something has changed in Windows 11, but I very doubt that Windows 11 implemented protocol detection and tries HTTP and SOCKS protocols on the same port, as your screenshot does not show any option for protocol selection and I have not found anything similar on the internet.

Thus, I'd guess your system does have additional proxy configuration which is apparently working somehow. Could it be you have software like proxyfier?

d3vv commented 2 years ago

I don't have any like proxifier or something like Layered Service Provider modifications.. Please be advised that all I did it is just enable global proxy settings for whole system here:

proxy2

I am not forcing the tor-relay-scanner to use this proxy.. In my case, it breaks itself when this option is enabled..

ValdikSS commented 2 years ago

This option supports only HTTP (CONNECT) proxies. In the OP you said you use SOCKS proxy.

With HTTP proxy, I managed to reproduce the bug. The request is executed to the proxy, but without any proxy protocol at all. WIll look.

ValdikSS commented 2 years ago

https://github.com/psf/requests/issues/6139

d3vv commented 2 years ago

@ValdikSS okey-dockey, maybe I just wrong for something, but have no issues using sosks5 into windows 11 as global settings at work.. At home I tried http-only proxies too like squid, oops and result was the same..

ValdikSS commented 2 years ago

I fixed (or workarounded) the issue in requests, the exe file has been rebuilt with this update. The version is still the same. Could you try and check if it's working for you?

d3vv commented 2 years ago

Yes, it works! Thank You in Advanced

d3vv commented 2 years ago

I have one question: does it use such "global system proxy" by default?

ValdikSS commented 2 years ago

Yes, but only to download the list of relays, not to scan them.