How to connect a Socket server via HTTP proxy

后端 未结 8 1181
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 14:08

I have a piece of code to connect to a Socket server, and it works fine.

Socket socket = new Socket();
socket.connect(new InetSocketAddress(address, port));
         


        
8条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-02 14:27

    Looks like you're requesting a SOCKS proxy, which is different from an HTTP proxy. Perhaps try Proxy.Type.HTTP.

    Question: is your client HTTP based? I'm not sure this will work unless your client speaks HTTP.

提交回复
热议问题