Better error messages and debugging information....
I successfully used TrevorProxy on one of my servers, but on the second server with same provider having the same networking setup but using Ubuntu instead of Debian I am not able to connect and get this error:
trevorproxy subnet -s XXX:YYY::/64 -i enp129s0f0
[DEBUG] ip route add local XXX:YYY::/64 dev enp129s0f0
[INFO] Listening on socks5://127.0.0.1:1080
But:
curl -v --proxy socks5://127.0.0.1:1080 -6 api64.ipify.org
* Closing connection 0
curl: (7) Couldn't connect to server
From this it looks like the proxy server is not running as no connection request is logged by the server, I have checked that firewall and it seems the proxy is listening correctly.
lsof -i :1080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
trevorpro 159845 root 4u IPv4 296659 0t0 TCP localhost:socks (LISTEN)
So, the question is how to get more information where is this failing?
Hi, I was facing the same issue. It turns out that you need to remove the -6 flag un the curl command. This is a workaround, but it would be great if someone could investigate what is the root of this. Likely it's sth. quite simple.
IPv4 mapped IPv6 addresses seem to work. curl -6 seems to expect every address to be IPv6, so you'll have to use this: curl --proxy socks5://[::ffff:127.0.0.1]:1080 -6 api64.ipify.org
This does give me the following the trevorproxy log output:
[DEBUG] ip route add local WWW:XXXX:YYYY:ZZZZ::/64 dev wlan0
[INFO] Listening on socks5://127.0.0.1:1080
[DEBUG] Accepting connection from 127.0.0.1:53138
[DEBUG] Address type == IPv6
[DEBUG] Destination address: 2a00:1450:401b:801::200e (note: google.com)
[DEBUG] 10 matches address family (10), randomizing source address
[INFO] Using random source address: WWW:XXXX:YYYY:ZZZZ:6bf9:3ef9:b577:d0f5
However, after some time it eventually gives:
[ERROR] Error in reply: Traceback (most recent call last):
File "/home/tosuman/repos/trevorproxy/env/lib/python3.12/site-packages/trevorproxy/lib/socks.py", line 139, in handle
remote.connect((address, port))
TimeoutError: [Errno 110] Connection timed out
I tried different hosts, but it just doesn't seem to work.
I had the same Connection timed out when not using the "-6" flag & a "connection closed" when using the "-6" flag initially.
Have you checked if you have access to the /64 range? I had the same issue (while setting up on linode) initially. Turns out you get a single ipv6 address by default, and need to add a range. This can be done very easily in linode from Networking -> Add an IP address. After that it worked flawlessly 👍.