Got java.net.ProtocolException: Unexpected status line: '� HTTP/1.1 200 OK' while SOCKS5 return command response with address type 'DOMAIN'
See original GitHub issueHere is my test case
The SocksServer comes from Netty’s sample https://github.com/netty/netty/blob/4.1/example/src/main/java/io/netty/example/socksproxy/SocksServer.java
And I just make it can start programatically
MockWebServer server = new MockWebServer();
server.enqueue(new MockResponse().setResponseCode(200).setBody("HelloWorld!"));
server.start();
SocksServer proxy = new SocksServer();
proxy.start();
OkHttpClient client = new OkHttpClient.Builder()
.proxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", proxy.port())))
.build();
Response response = client.newCall(new Request.Builder()
.url(new URL("http://127.0.0.1:" + server.getPort()))
.build())
.execute();
assertTrue(response.isSuccessful());
assertEquals(200, response.code());
assertEquals("OK", response.message());
assertEquals("HelloWorld!", response.body().string());
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Retrofit "java.net.ProtocolException: Unexpected status line ...
i add a network interceptor and add the close connection header to it for the okhttp3 client. okHttpClient = new OkHttpClient.Builder() .
Read more >java.net.ProtocolException: Unexpected status line - B4X
The http response is invalid. It should start with the status line (ex: Http/1.1 200 OK). You can use Socket with AsyncStreams to...
Read more >StatusLine.java - Google Git
Sets the response status line (like "HTTP/1.0 200 OK"). */. public StatusLine(String statusLine) throws IOException {. // H T T P / 1...
Read more >Fix list for IBM MobileFirst Platform Foundation / IBM Worklight
PI45898, HTTP CLIENT PROTOCOL EXCEPTION WHEN CALLING JAVA ADAPTER. ... TO INSTALL MFP ON TOMCAT IF CONNECTOR'S PROTOCOL IS NOT HTTP/1.1.
Read more >Neuron 3.7.0.929 - Point DNS to WP Engine
Now we do not load the test messages in the runtime. Neuron 3.7.0.921. Runtime. FIX – Neuron ESB Service could shut down with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is the tcpdump traffics follow tcp stream with port 1080, printed in Hex Dump format
The response line is 05 00 00 03 09 31 32 37 2e 30 2e 30 2e 31 e7 2e 05: socks ver 00: success 00: reserved 03: address type domain name 09: string len 31 32 37 2e 30 2e 30 2e 31: string ‘127.0.0.1’ e7 2e: port 59182
According to https://tools.ietf.org/html/rfc1928, section 6. Replies The address type 03 is a valid value
Is this related to #3662 , I still got the error:
java.net.ProtocolException: Unexpected status line: achefly.cachefly.net��PHTTP/1.1 200 OK