首页 > 解决方案 > 如何处理flutter中的websocket错误

问题描述

我尝试在后端使用node.js、express和socket io进行实时聊天......然后我在客户端使用flutter......问题是......我收到错误消息:

D/FlutterSocketIoPlugin: SocketIO(22042): connect_error: [{"cause":{"detailMessage":"Expected HTTP 101 response but was \u0027404 Not Found\u0027","stackTrace":[],"suppressedExceptions":[]},"detailMessage":"websocket error","stackTrace":[],"suppressedExceptions":[]}]
D/FlutterSocketIoPlugin: SocketIO(22042): reconnect_error: [{"cause":{"cause":{"detailMessage":"Expected HTTP 101 response but was \u0027404 Not Found\u0027","stackTrace":[],"suppressedExceptions":[]},"detailMessage":"websocket error","stackTrace":[],"suppressedExceptions":[]},"detailMessage":"Connection error","stackTrace":[],"suppressedExceptions":[]}]

有什么我想念的吗?

标签: node.jsflutterwebsocket

解决方案


推荐阅读