actix-web: does not work with flutter (websocket)

I have a webserver (actix_web) that i want a mobile application to communicate with. I choose flutter but having trouble to get a websocket connection going. I can connect from the flutter side and it looks like everything is working without any problems but immediately after the websocket actor and my StreamHandler is started the StreamHandler and websocket actor are finished and stopped without an error or a close message and of course i cannot send any message from the flutter client.

I have no problems to connect from js (a simple website) or a python client to my actix webserver but i just can’t get the flutter client to work. One could immediately guess this is the fault of the flutter client but i can connect to "ws://echo.websocket.org’ and to a python websocket server without problems from the flutter client.

I have created a repository with all the examples (simple echo servers with clients [adjust the ip’s]) and all combinations for clients and servers are working except Flutter + actix_web

i also opened an issue for flutter

EDIT: i also added a pure dart version with the same behavior but without the need of all the flutter and mobile stuff in the raw_dart folder. just dart main.dart should be enough with dart installed and no need for android studio/xcode and or mobile devices / emulators.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

fixed in master.

dart client sends “content-length” header in request, and that is the problem.