Websocket configuration
See original GitHub issueWhat is troubling you? I’m struggled to configure websocket nginx on my NPM: https://extiverse.com/extension/kyrne/websocket
That’s my current config:
Full Custom Nginx Configuration:
proxy_hide_header Upgrade;
proxy_hide_header X-Powered-By;
add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Cache-Control "no-transform" always;
add_header Referrer-Policy no-referrer always;
add_header X-Robots-Tag none;
location @ws {
proxy_pass http://$server:1234;
proxy_set_header Host $http_host;
proxy_read_timeout 60;
proxy_connect_timeout 60;
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_cache_bypass $http_upgrade;
}
Where 1324
is the port of my websocket application.
Unfortunately - I can’t establish connection. From browser console:
Pusher : : ["Connecting",{"transport":"ws","url":"wss://dev.mywebsite.com:443/app/(...)?protocol=7&client=js&version=5.1.1&flash=false"}]
WebSocket connection to 'wss://dev.mywebsite.com/app/(...)?protocol=7&client=js&version=5.1.1&flash=false' failed: Error during WebSocket handshake: Unexpected response code: 404
I can connect into it without proxy like:
wss://dev.mywebsite.com:1234
What I’m doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Configure WebSocket connections
Create a WebSocket handler · In the Policy Studio tree, select a list of relative paths (for example, Environment Configuration > Listeners >...
Read more >Using WebSocket to build an interactive web application
Click Dependencies and select Websocket. Click Generate. Download the resulting ZIP file, which is an archive of a web application that is configured...
Read more >Configure WebSocket connections
Configure a WebSocket connection · In the Policy Studio tree, select a list of relative paths (for example, Listeners > API Gateway >...
Read more >WebSocket Connection Configuration - Oro Documentation
Configure a Web Server to ensure messages interaction between the WebSocket server and the clients. ; Configure WebSocket-Related Application Parameters to ...
Read more >Writing WebSocket client applications - Web APIs | MDN
This simple example creates a new WebSocket, connecting to the server at wss://www.example.com/socketserver . A custom protocol of "protocolOne" ...
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
Is it possible to write a documentation for websocket? There’s only a few article with npm and websocket. I’ve got a fully functional websocket but when I try to migrate from my old nginx reverse proxy to npm, I can’t set the websocket part correctly
I have solved my same problem by adding inside location block. password protect domain with access and https enabled. now both works like well-oiled engine.