-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocket 连接异常 #53
Labels
help wanted
Extra attention is needed
Comments
应该是连接地址不正确,正确的 websocket 连接地址在连接的时候会返回状态码 101,你这个地址它返回了 200 |
他是http协议的websocket |
然后还带端口号 |
那这确实不是 WebSocket 协议,可能是 SockJS 协议 |
是安卓端吗??安卓端不支持socketjs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.dppdkai.luckypandemo, PID: 10154
com.ejlchina.okhttps.internal.HttpException: WebSockt 连接异常: ws://myphp.com
at com.ejlchina.okhttps.internal.WebSocketTask$MessageListener.onFailure(WebSocketTask.java:278)
at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:570)
at okhttp3.internal.ws.RealWebSocket$1.onResponse(RealWebSocket.java:199)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.net.ProtocolException: Expected HTTP 101 response but was '200 OK'
at okhttp3.internal.ws.RealWebSocket.checkUpgradeSuccess(RealWebSocket.java:224)
at okhttp3.internal.ws.RealWebSocket$1.onResponse(RealWebSocket.java:195)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
The text was updated successfully, but these errors were encountered: