Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
- }
- upstream websocket {
- server ваш_ип:2000;
- }
- location /websocket {
- proxy_pass http://websocket;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- keepalive_timeout 604800;
- proxy_connect_timeout 604800;
- proxy_send_timeout 604800;
- proxy_read_timeout 604800;
- var socket = new WebSocket("ws://ваш_ип_или_домен/websocket");
- var socket = new WebSocket("ws://ваш_ип_или_домен:9999");
Add Comment
Please, Sign In to add comment