Answer the question
In order to leave comments, you need to log in
Why am I getting an Invalid Namespace error when connecting to a Socket.io Server?
Hello. On the server, I have Nginx configured for a Socket.io connection.
location /socket.io/ {
root /var/www/socket.io_service;
proxy_pass http://localhost:3004;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
const io = require('socket.io-client')('http://my_server_ip/socket.io/')
Answer the question
In order to leave comments, you need to log in
Looked at https://www.tutorialspoint.com/socket.io/socket.io... and https://socket.io/docs/namespaces/ . I have an android, there is also such an error. I changed the URL (removed "socket.io/" at the end), after that the error disappeared, and the connection seemed to appear. I will continue searching further.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question