Flutter 和 Phoenix Channels 的问题
Issues with Flutter and Phoenix Channels
我们的 Flutter App 和 Pheonix Web Sockets 有一些问题。我们知道后端工作正常,因为 JavaScript 客户端功能齐全。但是使用 Flutter 应用程序我们无法连接到服务器。
final socket = PhoenixSocket("ws://###.##/socket");
connectSocket() async {
await widget.socket.connect();
_channel = widget.socket.channel("test:lobby")
_channel.on("say", _say);
_channel.join();
}
其中一个错误是 gettig:
I/flutter ( 4227): WebSocket connection to ws://###.##:8080/socket?vsn=2.0.0 failed!: WebSocketException: Connection to 'http://###.##:8080/socket?vsn=2.0.0#' was not upgraded to websocket
在客户端,我们使用 Phoenix Wings,端口和 URL 是正确的。
为什么这种情况一直发生?
Flutter with Phoenix Interactions 是否还有其他库?
phoenix_wings 或任何其他软件包是否有更好的文档?
我让它工作为
final socket = PhoenixSocket("ws://####.###/socket/websocket");
hth.
我们的 Flutter App 和 Pheonix Web Sockets 有一些问题。我们知道后端工作正常,因为 JavaScript 客户端功能齐全。但是使用 Flutter 应用程序我们无法连接到服务器。
final socket = PhoenixSocket("ws://###.##/socket");
connectSocket() async {
await widget.socket.connect();
_channel = widget.socket.channel("test:lobby")
_channel.on("say", _say);
_channel.join();
}
其中一个错误是 gettig:
I/flutter ( 4227): WebSocket connection to ws://###.##:8080/socket?vsn=2.0.0 failed!: WebSocketException: Connection to 'http://###.##:8080/socket?vsn=2.0.0#' was not upgraded to websocket
在客户端,我们使用 Phoenix Wings,端口和 URL 是正确的。
为什么这种情况一直发生?
Flutter with Phoenix Interactions 是否还有其他库? phoenix_wings 或任何其他软件包是否有更好的文档?
我让它工作为
final socket = PhoenixSocket("ws://####.###/socket/websocket");
hth.