websocket problems 502
See original GitHub issueI’ve logged an issue here (https://github.com/chimurai/http-proxy-middleware/issues/15) where I am having a problem with browser-sync, http-proxy-middleware and websockets
In a nutshell, I have this code
var server = {
baseDir: baseDir,
routes: routes
};
var proxies = [];
proxies.push(proxyMiddleware('/socket.io', {
target: 'http://localhost:5000/' , ws: true
}));
server.middleware = proxies;
browserSync.instance = browserSync.init({
startPath: '/',
server: server,
browser: browser
});
but get these errors :
woot! connection
[HPM] Upgrading to WebSocket
[HPM] Client disconnected
and the client console has
WebSocket connection to 'ws://mysite.io/socket.io/?EIO=3&transport=websocket&sid=5_BeDfck0LFYcYxPAAAA' failed: Error during WebSocket handshake: Unexpected response code: 502
and obviously, I can’t get my websocket connected.
Am I missing something or is it a bug ?
thanks
Issue Analytics
- State:
- Created 8 years ago
- Comments:30 (3 by maintainers)
Top Results From Across the Web
websocket - How do I fix this NGINX 502 Bad Gateway error?
I was using WebSockets over SSL (so wss:// protocol) and had 502 popping up, even though the config had worked before.
Read more >WebSocket connection handshake Error 502 #310 - GitHub
I had some problems with it (using Cloudflare for TLS). I found the following works. .env. # //deployer.domain.com so it's wss:// but uses...
Read more >How to Solve 502 Bad Gateway Issues? - KeyCDN Support
Having issues with a 502 Bad Gateway error? This guide gives you practical tips to solve origin not reachable problems.
Read more >Error 502 when connecting to my project's websocket
Having the same issue with websocket connection to glitch also. While in the past it worked flawlessy, now connection just fails with status ......
Read more >502 Bad Gateway - Socket hang up | Apigee Edge
Check the Edge Microgateway logs: · Search to see if there are any 502 errors with code ECONNRESET during a specific duration (if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ibc your example does not work! Notice that your example is effectively the same as the OP’s.
Hi,
I am also having an issue with websockets in server mode. Here is my gulp config:
It usually terminates with this error:
Connection closed before receiving a handshake response