我们的Flutter应用程序和Pheonix Web套接字出现了一些问题。我们知道后端工作正常,因为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是正确的。
为什么总是这样?
有没有其他的库可以支持带有Phoenix Interactions的Flutter?有没有更好的phoenix_wings或其他包的文档?
1条答案
按热度按时间6jjcrrmo1#
我把它当作
h小时。