java runtime 6 with socks v5 proxy - Possible?

后端 未结 2 703
深忆病人
深忆病人 2021-02-15 22:59

I have written an application that (amongst other things) runs a local service in windows that acts as a SOCKS v5 proxy for Firefox.

I\'m in the debugging phase right no

2条回答
  •  余生分开走
    2021-02-15 23:51

    new InetSocketAddress(hosta, port) which resolve IP by Default, and SocksSocketImpl use IP first if the target address is resolved. If you want RemoteDNS, you can new Socket you An Proxy,then connnect to a InetSocketAddress which is constructed by InetSocketAddress.createUnresolved(host, port).

    You Socks Server must be SOCKS5, java SocksSocketImpl auto detect is version.

    Proxy p = new Proxy(Proxy.Type.SOCKS, paddr);
    Socket s = new Socket(p);
    InetSocketAddress addr = InetSocketAddress.createUnresolved("host.blocked.by.gfw", port);
    s.connect(addr);
    

提交回复
热议问题