droppy icon indicating copy to clipboard operation
droppy copied to clipboard

Websocket Handshake Unexpected Error

Open dashpot4 opened this issue 7 years ago • 4 comments

I am using Chrome and accessing droppy on my docker in Synology device but I could not be able to access droppy page due to the websocket connection error: WebSocket connection to 'wss://drop.DOMAINNAME.com/!/socket' failed: Error during WebSocket handshake: Unexpected response code: 307

It works well via HTTP with port number but it does not work with the domain secured by HTTPS. Error occurs at "client.js:1"

What should I do to resolve this problem?

dashpot4 avatar Nov 06 '18 20:11 dashpot4

I'm running droppy 11.1.0 on node 12.15.0, on ubuntu bare metal (not docker), behind nginx proxy.

It works fine in Firefox.

In Chrome, I get: WebSocket connection to 'wss://73k.us/drop/adam/!/socket' failed: HTTP Authentication failed; no valid credentials available ...and the interface doesn't load after submitting login credentials, just goes to a blank dark gray.

If I use the local IP+port instead, it works in chrome.

apiontek avatar Feb 09 '20 14:02 apiontek

If you are using Nginx do something like that:

location /droppy/ {
			rewrite /droppy/(.*)$ /$1 break;
			
			proxy_ssl_server_name on;
			proxy_pass http://app_droppy;
			proxy_redirect off;
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "upgrade";
			proxy_set_header Host $host;
		}
	}

I also had that problem and I solved it by adding the headers.

SergioSaar96 avatar Mar 31 '20 15:03 SergioSaar96

For me, my websocket Auth failed issue is dependent on the browser cache.

My droppy is ok on some computers, in all browsers, and only fails on two computers in Chrome.

For the browsers where this websocket auth error occurs, if I go to the devtools (F12), the Application area, click "Clear Storage" under Application, and then with everything checked for the site, click "Clear site data" button, and reload droppy, I'm able to sign in and everything loads fine.

apiontek avatar May 01 '20 16:05 apiontek

So others looking for the solution: All I had to do was add the header lines mentioned above to fix the problem.

vdefender avatar Oct 02 '20 17:10 vdefender