简体   繁体   English

java.net.SocketException:来自 SOCKS 服务器的错误回复

[英]java.net.SocketException: Malformed reply from SOCKS server

i try to create SSLSocket with socket but i get this exception我尝试使用套接字创建 SSLSocket,但出现此异常

 SocketAddress proxyAddr = new InetSocketAddress(proxyHost, proxyPort);
Socket underlying = new Socket(new Proxy(Proxy.Type.SOCKS, proxyAddr));
underlying.connect(new InetSocketAddress(host, port));
SSLSocket socket = (SSLSocket) factory.createSocket(underlying,proxyHost,proxyPort,true);

Exception: java.net.SocketException: Malformed reply from SOCKS server异常:java.net.SocketException:来自 SOCKS 服务器的错误回复

Thank you for your help谢谢你的帮助

您已将应用程序配置为使用 SOCKS 代理,但您指定为proxyAddr的 host:port 上的实体不是 SOCKS 服务器。

To fix this:要解决此问题:

1) Open Tools -> Internet Options in Internet Explorer (or alternatively, Control Panel Network Settings in Windows 7) 1) 在 Internet Explorer 中打开工具 -> Internet 选项(或者,在 Windows 7 中打开控制面板网络设置)

2) Open Connections tab 2) 打开连接选项卡

3) Click on LAN settings 3)点击局域网设置

4) If "Use a proxy server" is enabled, click Advanced and disable "Use the same proxy server for all protocols" 4) 如果启用了“使用代理服务器”,请单击“高级”并禁用“对所有协议使用相同的代理服务器”

This just controls what Internet Explorer does. 这只是控制Internet Explorer的功能。 It has nothing to do with Java. 它与Java无关。 The OP's code is explicity use a SOCKS proxy, or trying to. OP的代码是显式地使用SOCKS代理,或试图这样做。 Not relying on any Control Panel setting 不依赖任何控制面板设置

Wrong on Windows.... Internet Options controls the way Windows use Proxyserver, Internet Explorer is just one Application that uses the "Windows Standard configuration" Java in Standardconfig uses the "Systemstandard" to connect, so if you don't specify the Proxyserver via Java this workaround will help, but it'S not a "solution". Windows上的错误。...Internet选项控制Windows使用Proxyserver的方式,Internet Explorer只是使用“ Windows Standard配置”的一个应用程序。Standardconfig中的Java使用“ Systemstandard”进行连接,因此,如果您未指定Proxyserver通过Java,此解决方法将有所帮助,但这不是“解决方案”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.net.SocketException:使用apache FTPClient从SOCKS服务器返回的格式错误 - java.net.SocketException: Malformed reply from SOCKS server, With apache FTPClient 获取java.net.SocketException:来自SOCKS服务器异常的格式错误的答复 - Getting java.net.SocketException: Malformed reply from SOCKS server Exception 无法连接日食市场-I / O异常(java.net.SocketException)来自SOCKS服务器的格式错误的答复 - unable to connect eclipse market place - I/O exception (java.net.SocketException) Malformed reply from SOCKS server 为什么我的 SOCKS 代理代码抛出 SocketException: Malformed reply from SOCKS server? - Why does my SOCKS proxy code throw SocketException: Malformed reply from SOCKS server? 来自Maven项目中的袜子服务器的格式错误的答复 - Malformed reply from socks server in maven project 引起:java.net.SocketException:来自服务器的文件意外结束 - Caused by: java.net.SocketException: Unexpected end of file from server 异常:java.net.SocketException:来自服务器的文件意外结束 - Exception: java.net.SocketException: Unexpected end of file from server java.net.SocketException:来自服务器的文件意外结束 - java.net.SocketException: Unexpected end of file from server 服务器/客户端java.net.SocketException - Server/Client java.net.SocketException 客户端和服务器中发现java.net.SocketException - java.net.SocketException noticed in client and server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM