Closed SaabirMohamed closed 3 years ago
Resolved: I tested my project by initialising it using the heroku demo (works perfectly...thanks for making that available) That made me focus on nginx confs ...after some googling , appears was this line in the config (lowercase "u" proxy_set_header Connection "upgrade";), just tried it as per the stackoverflow suggestion. I added it as an extra line and added location /socket.io/ as another proxy_pass entry the error seems to be gone (I'm able to create a test user and authenticate as well)
Maybe this will help someone else who happens to face this issue.
Hi @SaabirMohamed
The problem is about your base url Remove the leading "/" and it will work. Also, you don't need to put the port number (:'0') in the url.
To enable websocket on nginx, use just this in your server block:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Your must have:
https://www.mysite.xyz as baseUrl
The "flutter: WebSocketException: Connection to 'https://www.mysite.xyz:0/socket.io/?EIO=3&transport=websocket#' was not upgraded to websocket" mean that flutter_feathersjs cannot reach out the socketio server because the baseUrl is incorrect.
Let me known if this help
Hi Team
I am having this issue when running the init with base url my init looks like this flutterFeathersjs.init(baseUrl: "https://www.mysite.xyz/api/"); I.m initialising the instance from an Oninit() hook in my GetxController
flutter logs this error : flutter: WebSocketException: Connection to 'https://www.mysite.xyz:0/socket.io/?EIO=3&transport=websocket#' was not upgraded to websocket Notice the https://www.mysite.xyz**:0** (colon zero at the end of the url...port being added to the url in the error message) I don't know if this is the problem why ...I am testing my backend and all configs are fine on the backend.
this is my Nginx: (for that block - its all that that's required right?) location /api { proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $http_host; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:10123; }
all my restful services work fine via postman only when I use this lib and run this init...I get the socket upgrade issue
can someone please assist (is there something that's appending the :0 at the end of the url?)