-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wss: Error during WebSocket handshake: Unexpected response code: 200 #979
Comments
This is strange. Did you try with other browsers? Does it work with Firefox? |
The site itself is rerouted through a nginx reverse proxy. Firefox and Chrome work fine, I've only seen this issue on Chromium. My project is open-source; would it help if I provided you my source code + wss url to help you debug? |
Maybe, but if you have already isolated the issue to be Chromium specific I think there is not much I can do. |
As I've said, directly connecting results in this:
Regarding my sidenotes, is there already a system to include this module in a browser using a <script> tag, or would I have to browserify it myself? |
Oh sorry didn't understand that part.
No, there isn't and there are parts which can't be "browserified" as there is no way to have access to raw TCP sockets from the browser using JavaScript. |
Closing this as I think there is not much we can do. @Ratismal please reopen if needed. |
Fair enough. Thank you for your support. |
A fix for me was setting these response headers: Host, Connection and Upgrade. location /foo/ {
proxy_pass http://foobar:3005/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
} |
@mklimek This worked great for my setup. Thanks. |
@mklimek Worked for me! Thank you! |
@mklimek @venkateshthallam @PassTheMayo You guys are commenting on |
@naknode Read the previous comments, this issue was resolved. |
nginx don't support websocket,but it can proxy websocket connetions,you neet config it: Reference link: |
resolved my issue |
@mklimek This worked great for my setup. Thanks. |
@mklimek , that worked 100%. |
I think your server used sockjs, client not use. |
Any note on how to solve this in IIS using nodeiis? |
What we use is: then in add |
I think this was a general web socket issue, i experienced the same error while working with SignalrR for an asp.net core site hosted on linux. I changed nginx config file specifying 'proxy_set_header Connection "upgrade"' and everything worked. Thank you for your suggestion sir! |
A hero can be anyone, even a man doing something as simple as putting a working nginx config in Github issues. |
Kindly, referring to your solution above, I need to apply it using apache as I have the same issue, so please feedback me about the needed code for apache. |
this saved my life tonight. Thank you! |
I not able to solve the issue on my AWS ElasticBean instance... maybe someone could provide some much appreciated insights on what is the problem with my nginx config file below:
|
Any one can provide the same solution for apache ? |
Amazing, worked for me too like a charm, as i was banging my hand since a couple of days on account of setting this reverse proxy configuration in nginx, |
How I can create this header in apache? |
This document is for those who use laravel-echo-server & Nginx & socket.io & Redis-server with the separated server between client project and Redis-server. Please follow the link here. Thanks |
Is there any fix for those who are hosting on Heroku and not Nginx? |
Does anyone have a reverse proxy setup for Apache to make the websocket work? |
Hlo everyone please solve my issue found in my apache live server regarding websocket connetion. I am using wss + ssl on live server but connection failed. If you have any solution so let me know ASAP. If any proxy to use so let me know. |
HI, works for me :-) apche2 config
https://stackoverflow.com/questions/65102311/convert-nginx-conf-to-apache-conf-for-proxypass |
Salutations,
I'm running a WebSocket server using this module, but am having issues connecting with certain browsers. The server is served through ssl, so I connect to it using wss.
The Issue
When I connect to the website using Google Chrome, everything works as intended. However, when I try to connect using Chromium, I get the following error:
It should be noted that the client connects perfectly fine on my test instance, connecting to
ws://localhost:8085
. This seems to be an issue only with wss protocols. Obviously, using ws protocols over an ssl connection is not a viable option.I have tried directly connecting via IP and port, but get the following error:
My Code
Server:
Browser:
Sidenotes
I suspect this issue is due to chromium's websocket support itself. I noticed that there is client support available. Is there a browserified version of this module available for me to load via a <script> tag, or another means to use this module in a browser?
The text was updated successfully, but these errors were encountered: