0

I have defined following Sock5 proxies using TSocks. Following is my Tsocks file

local = 192.168.5.0/255.255.255.0

# Otherwise we use the server
server = 192.168.5.1

#HKG
path {
server = localhost
server_port = 8082
reaches = 10.110.80.0/255.255.255.0
server_type = 5
}

#DCA
path {
server = localhost
server_port = 8081
reaches = 10.125.4.0/255.255.255.0
server_type = 5
}

Now tsocks telnet IP PORT is working, However Java is not able to get proxy as tsocks java class is giving connection time out when connecting with IP at PORT

How to make Java to pick this proxy setup?

Mangat Rai Modi
  • 5,397
  • 8
  • 45
  • 75

1 Answers1

0

Answering my Question

This is a known bug with tsocks. Tsock won't work with any application which uses Poll to to wait at a socket. JVM and Chrome are two examples. Following link has the description of the bug and a patch to fix -

Tsock poll bug patch

Patch is not official and Tsocks official repository is dead form 10 years. It would be better to use ProxyChains if possible

EDIT: Patch is not working. However the problem is same as listed in the bug report. I will come up with my own patch

Mangat Rai Modi
  • 5,397
  • 8
  • 45
  • 75
  • Do you known solution for tsocks + java? – Hubbitus May 28 '15 at 12:01
  • Hi, As mentioned in the edited post, last time I tried the patch wasn't working :( I have changed my problem statement to completely erase the need of tsocks. Btw, you could try Proxy chains. I read that its working with Java – Mangat Rai Modi May 28 '15 at 13:41
  • I also have tried proposed patches and they are had not working for me. It is why I ask. ProxyChains unfortunately can't setup "paths" in terms of tsocks configuration. To define proxies only for chosen destinations. – Hubbitus May 29 '15 at 09:31
  • Proxychains doesn't properly support java either. – kb1000 Mar 20 '20 at 10:46