@pichalite Thank you for the response.
That was most peculiar, but I reset the config.json to be how it was and it stopped having this error.
Besides I still think it's best to check data.config, before extracting data.config.loggedin anyway.
Hello,
I just noticed that i am getting the following websocket error in the chrome console:
nodebb.min.js:5 WebSocket connection to 'ws://mydomain.com/socket.io/?EIO=3&transport=websocket&sid=bNvLK8Xh-fCr0hErAAAj' failed: Error during WebSocket handshake: Unexpected response code: 400
I am using apache 2.4 to redirect traffic to the nodebb port:
My Apache config is:
ProxyPass /socket.io/1/websocket ws://127.0.0.1:4567/socket.io/1/websocket
ProxyPassReverse /socket.io/1/websocket ws://127.0.0.1:4567/socket.io/1/websocket
ProxyPass /socket.io/ http://127.0.0.1:4567/socket.io/
ProxyPassReverse /socket.io/ http://127.0.0.1:4567/socket.io/
ProxyPass / http://127.0.0.1:4567/
ProxyPassReverse / http://127.0.0.1:4567/
Anyone know why i am getting the error?
Thanks,
Websockets work fine when i point my browser directly to the IP:PORT of the server, so its just when i visit the domain name. Thanks
Are you using CloudFlare?
Hello, no i am hosting it myself. I am using apache to redirect domain name traffic to the nodebb port. Thanks.
Anyone? I also tried adding the bind address setting to nodebbs config file but that also didnt change anything. Is there another setting in Apache that i need to add to route the domain requests to the ip:port of nodebb?
Thanks,
@whitts don't think many use apache so, getting help on that is not going to be easy... most here use Nginx.
@whitts I have seen websockets error for installations running on master and using Nginx (not on all but only some. doesn't happen on this community). Doesn't affect functionality though.
I gave up... I removed apache and installed NGINX.. No more socket io errors in the console.. Thanks.
Just curious but what does the error change feature wise? ... that the site inst using Web Sockets and therefore results to polling?
@whitts not sure about that... need to figure out why the error is happening on some but not all. I will probably create an issue on github.
@pichalite No problem.. its not doing it with nginx though so I will stick with that.
I'm on apache 2.4.7 this works for me after trying different things for a long time
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:4567/$1 [P,L]
ProxyPass / http://localhost:4567/
ProxyPassReverse / http://localhost:4567
should be probably updated in the official documentation
@phit Thanks for the information.. I will give it a go if i ever move back to Apache. At least its on here now if anyone else has problems.
Hi,
I still have problem configurating apache...
With the new configuration (using the RewriteEngine) I get a 404 error instead of the 400.
Here a line from the access_log
[11/Mar/2016:13:25:03 +0100] "GET /ws://127.0.0.1:4567/socket.io/?EIO=3&transport=websocket&sid=Wo9q_vZG6QCSZ7-9AAFN HTTP/1.0" 404 4815 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36"
Any ideas on this?
Thanks
@fabian The leading slash in the route seems out of place...
@julian Thanks for the answer
I'm using apache 2.2.22 and it seems like there is a bug in that version wich causes the leading slash. I'm upgrading to 2.4 next week hoping this solves the issue...
An other option is the "<If ...>"
directive, but thats only available in 2.4, too...