Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curl: Can't connect to SOCKS5 proxy on server

Tags:

php

curl

I'm having the weirdest issue...

On my local machine, if I run this, it works (IP censored):

curl -x socks5://x.x.x.x:1080 --proxy-user anon:anon -L https://ip.me
x.x.x.x

However, if I run this on my server, I get this...

curl -x socks5://x.x.x.x:1080 --proxy-user anon:anon -L https://ip.me
curl: (97) Can't complete SOCKS5 connection to ip.me. (2)

Now, on the server, if I run

nmap -p 1080 x.x.x.x

It reports that the port is open and that the service is "socks".

I also tried running dpkg-reconfigure on curl but no dice.

Edit

I also tried connecting to the proxy from another machine, and it works. It really seems to be an issue on my OVH VPS specifically...

Edit #2

I just configured proxychains and used it on wget. I was able to connect to the proxy just fine, but curl still errors out...

Edit #3

I just compiled curl from source, I'm still getting the same connectivity issue.

Has anyone encountered a similar issue?

like image 955
lolc Avatar asked Dec 30 '25 21:12

lolc


1 Answers

I am so irrationally angry at this realization

Even if the proxy works elsewhere using socks5, try using socks5h.

Hopefully I can save someone 3 hours of their lives...

like image 157
lolc Avatar answered Jan 02 '26 12:01

lolc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!