Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Java.net.Proxy supports socks5, is there a way to support socks4 as well? third party library is ok too.

share|improve this question

1 Answer 1

java.net.Proxy SHOULD support SOCKSv4 but doesn't in either OpenJDK6 or OpenJDK7. I am planning to file a bug.

But the SOCKSv4 code is already there and can be turned on.

Use reflection to pull out the impl field in a java.net.Socket object. Cast that object to java.net.SocksSocketImpl. Use reflection to set the useV4 boolean field in this object to true.

Then connect and it should use SOCKSv4.

share|improve this answer
    
This is what happens when a bullshit company like Oracle takes over Sun. –  Zombies Feb 27 '10 at 1:33
1  
@Zombies - how so? Surely this issue predates any possible influence of Oracle culture on the Java team. –  Stephen C Feb 27 '10 at 2:03
    
Actually Oracle has been influencing java for some time, at least/best democratically, but now they have free reign. –  Zombies Mar 1 '10 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.