Questions tagged [websocket]

WebSocket is an API built on top of TCP sockets and a protocol for bi-directional, full-duplex communication between client and server without the overhead of http.

WebSockets (or WebSocket) is an API and a protocol for bi-directional, full-duplex communication over TCP sockets. The WebSockets API was originally part of the HTML5 standard, but it has been split off into a separate W3C standard. The WebSockets protocol is an IETF standard described in RFC 6455.

The WebSockets API has full browser support in Chrome 14, Firefox 6, IE 10 (desktop and mobile), Opera 12.1 (desktop and mobile), Safari 6.0 (desktop and mobile), Android 4.4, Chrome Mobile, and Firefox Mobile. Some older browsers have partial support or can be supported using a Flash based fallback.

WebSockets supports both unencrypted and encrypted connections. Unencrypted connections use the "ws://" URL scheme and default to port 80. Encrypted connections use the "wss://" URL scheme and default to port 443. Encrypted connections use Transport Layer Security (TLS).

Simple WebSockets browser JavaScript example:

if ("WebSocket" in window) {
    var ws = new WebSocket("ws://echo.websocket.org/");
    ws.onopen = function() {
        console.log("WebSockets connection opened");
        ws.send("a test message");
    }
    ws.onmessage = function(e) {
        console.log("Got WebSockets message: " + e.data);
    }
    ws.onclose = function() {
        console.log("WebSockets connection closed");
    }
} else {
    // No native support
}

Useful Links

Books

185 questions
1
vote
1 answer

Apache error "ProxyPass unknown Worker parameter" when using "upgrade=WebSocket"?

I am trying to relay the WebSocket connection of V2Ray with Apache according to This post, and the snippet below worked before. ProxyPass ws://127.0.0.1:{port}/{ws_path}/ upgrade=WebSocket ProxyAddHeaders Off …
whc2001
  • 25
  • 1
  • 4
1
vote
0 answers

Socket.io proxy through Apache and its performance

I am trying to setup a server for a Socket.IO game, but we will also have a little landing page in php served through Apache. I managed to make the server work by doing a proxy from Apache to the Socket.IO app. Apache is running on :80 and node on…
1
vote
0 answers

TLS websocket proxy with deep packet inspection/traffic logging

I have a very specific scenario in which maschines (IoT) are communicating with a central server over websockets. I need to inspect the websockets traffic (wss/tls) for audit and monitoring reasons (especially troubleshooting). We can't do it on the…
Kitano
  • 11
  • 1
1
vote
1 answer

How to accept HTTPS and Websockets on a new Google Kubernetes Engine deployment?

I set up a simple 1-node GKE deployment with the default (beta) ingress, created via the GCP console. I would like to set up a Google-managed SSL certificate and HTTPS proxy to the a single GKE node & service hosting HTTP & WebSockets. There are…
1
vote
0 answers

WebSockets + Apache and Nginx in “reverse proxy mode” + SSL/secure

As I had tried to connect PHP WebSocket from socketme.io through HTTP, since it was successful and again after loading certificates and making HTTPS it didn't work. As my hosting server's nginx is configured to work in proxy mode When website URL is…
1
vote
0 answers

HTML5/WebSocket Issues Windows Server 2011/2012/2016

We are having a strange issue with running a customer application but only on Windows Server machine, I did highly contemplate posting this to StackOverflow but as I suspect this to be a server configuration issue I felt it was best placed here…
1
vote
1 answer

wss not working in https but ws works in http apache2 ubuntu

My websocket setup works in http. But if I enable ssl(lets encrypt) and change the ws:// to wss://, browser throws this error. WebSocket connection to 'wss://xx.yy.xx.yy:5001/' failed: Error in connection establishment:…
supercontra
  • 225
  • 1
  • 3
  • 10
1
vote
1 answer

Websocket working within LAN but 502 error from remote client with nginx proxy

I have this really frustrating problem where my server which consists of an nginx reverse proxy and django/channels/daphne websocket host is functioning within the local LAN but from a remote client only the websocket connection can't be…
Chris
  • 111
  • 3
1
vote
0 answers

Using Apache to relay wss (web-socket) protocol to backend

I'm using Apache 2.4.27. I need to tunnel a client's wss request through an Apache reverse-proxy, to a backend server. However, from a tcpdump, it appears the wss request is being rejected by the Apache server. So I'm trying to debug this first…
1
vote
0 answers

Amazon AWS WebSocket Load Balancing Scale-In

We are in the process of developing a WebSocket application that will run on the same application servers that serve our APIs, which are all within a target group of a new Amazon Application Load Balancer. I'm not certain that a sticky session would…
1
vote
0 answers

Azure App Service Deployment not closing Node.js WebSockets connection

Background I'm having trouble with an Azure App Service Deployment. I'm using VSTS to do the deployment using the Azure App service Deploy feature. I'm deploying a Docker container to a Linux App Service slot. The Docker container is running a…
Sawtaytoes
  • 117
  • 6
1
vote
2 answers

"WS" HTTP Headers

I am working with a website running on IIS8.5 and I am seeing a set of requests with what I will call "WS" request headers showing up in the serverVariables collection as…
GWR
  • 165
  • 5
1
vote
0 answers

Websocket and CDN

I have an application which replies on both http and websocket: it is hosted outside the company server farm. This application is used both via browser/websocket and, through http, from applications running inside the SF (server2server) -- Obviously…
1
vote
0 answers

Why can Apache proxypass this when nginx can't?

I have an SSL host on my apache server with the following in the VirtualHost: ServerName server.com ServerAdmin email@email.com DocumentRoot /somepath/ ErrorLog ${APACHE_LOG_DIR}/error.log …
Joshua Pech
  • 111
  • 2
1
vote
3 answers

IP Tables intercept exception

I've got a set of iptable rules that look like this: -A PREROUTING --jump intercept-nat -A intercept-nat --jump DNAT -s 10.10.1.0/24 ! -d 10.10.1.1/32 -p tcp -m tcp --dport 80 --to-destination 10.10.1.1:3126 -m comment --comment "intercept-nat" -A…