现在有代理机器A(192.168.1.2),目标机器B(192.168.1.3),因为B设置了防火墙规则,代理机器A访问不了B,但是在代码里返回结果是isconnected是true,代码如下:
SocketAddress target= new InetSocketAddress("192.168.1.3","8001");
Socket echoSocket = new Socket(new Proxy(Proxy.Type.SOCKS,new InetSocketAddress("192.168.1.2",8888)));
echoSocket.connect(address);
boolean isconnected = echoSocket.isConnected();//true
看了下源码,isconnected返回的结果(true)其实是本机对代理机器的连通结果。我想得到的是本机通过代理对目标机器是否可连,怎么解决呢