无法连接到套接字服务器,出现错误:java.net.ProtocolException: Expected HTTP 101 response but was '404 Not Found'
.
代号:'
private fun run() {
val client: OkHttpClient = OkHttpClient.Builder()
.readTimeout(3, TimeUnit.SECONDS)
.build()
val request: Request = Request.Builder()
.url(AppParams.SOCKET)
.build()
client.newWebSocket(request, this)
client.dispatcher.executorService.shutdown()
}
'
URL格式为:"www.example.com网站"。https://url.com:3003/".
SocketIO库工作正常
已尝试删除前缀、更改端口、使用其它链路..
1条答案
按热度按时间axr492tv1#
您应该将链接更改为“wss:url.com:3003/“