为什么Java不支持socks4?

时间:2010-02-27 00:58:54

标签: java proxy socks

考虑以下代码:

    Proxy p = new Proxy(Type.SOCKS, new InetSocketAddress(proxyURL, port));
    try {

        long time = System.currentTimeMillis();
        URLConnection urlConn = url.openConnection(p);
        System.out.println(urlConn.getContent());
        int ping = (int)(System.currentTimeMillis() - time);
        System.out.println(proxyURL+ ":" +port+ " ... works as SOCKS, ping: " +ping);           
    } catch (IOException e) {
        //e.printStackTrace();
    }

我已经验证了Wireshark,这对有效的socks4代理无效。目前这些是有效的socks4 ONLY代理服务器:

92.241.233.75:1080
58.214.5.162:1080
222.51.38.138:1080
121.8.124.42:1080
220.179.61.62:1080
75.125.63.178:1080
201.59.145.141:1080
117.20.60.144:1080

然而,给它一个有效的socks5代理,它工作正常:

    62.243.224.179

1 个答案:

答案 0 :(得分:1)

Here is an answer。我没有测试它,但听起来它会工作(但不是一个理想的解决方案)。