Websocket not upgraded


Hi there

I am trying to make a real time application, including chat and notifications.
I followed documentations of AdonisJS line by line, and it finally works.

My .env file

ip: // OR
port: 3335

for the mobile part, I use Flutter Flutter.io to make the apps, but there is a problem which I don’t know it is from Adonis side or Dart ( Flutter ) side.

My Adonis websocket works well inside browsers

Desktop Chrome Browser
ws:// OK

Real mobile devices Chrome Browser
ws:// OK            //( is my pc ip )

Emulator Chrome Browser
ws:// OK         // if I forward my emulator port
ws:// OK
ws:// OK

I also changed my server ip to so that requests other than localhost can reach it,

The problem is Flutter requests always fail with following error

WebSocketException: Connection to ''
 was not upgraded to websocket

but on the other hand, the same code in Flutter can easily connect to
wss://echo.websocket.org url !

I almost read every topic about it, not sure this exception is related to which side, flutter or adonis js (Node JS).

Any idea, any experience, any suggestion

Thank you in advance



hi i have a question can i connect a flutter app with adonisjs , are there problems ?



Hey @ghost :wave:

Please, create your own topic and be more descriptive.



You have to use ws and not http for making Websocket connections.