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

197 questions
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 …
KatDevsGames
  • 111
  • 3
1
vote
0 answers

Issue deploying Flask Rest Api on Nginx

I'm trying to deploy my flask api rest on nginx (on a subdomain) without success. I've followed this example from Digital Ocean and everything was working properly but then I changed the tutorial example code to my mine and POST requests aren't…
NeoSennin
  • 51
  • 6
1
vote
1 answer

How do I forward websocket communication through an intermediary server?

I'm trying to connect a websocket server (linux machine) and client (web browser) through an intermediary server (hosted on an AWS EC2 instance). The EC2 instance provides a public IP that the websocket server and client can reference. My client…
Nick Sweet
  • 113
  • 1
  • 4
1
vote
1 answer

No protocol handler was valid for the URL /url. If you are using a DSO version of mod_proxy

Trying to set up a load balancer using Apache 2.4.x on Windows. Error: No protocol handler was valid for the URL /path/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using…
Himani Singla
  • 11
  • 1
  • 2
1
vote
0 answers

WebSockets with TeamCity behind Amazon ELB

I'm setting up TeamCity behind a public ELB in Amazon. I am attempting to fix the WebSocket connection issue: Some users cannot use optimized web UI updates via WebSocket protocol. This is a standard, default install of TeamCity listening on port…
Thomas Farvour
  • 141
  • 1
  • 1
  • 3
1
vote
0 answers

When does the Nginx error happen, recv() failed (110: Connection timed out) while proxying upgraded connection

I am using Nginx 1.10.1 for my APP to balance connections on Websocket. For example, the App A(multi-process) establish Websocket connections to B1, B2 through Nginx so that the connections could be balanced. While using it, sometimes even though…
asleea
  • 159
  • 1
  • 1
  • 9
1
vote
0 answers

nginx SSL termination with sticky load balancing

I want to use Nginx with a socket.io app with TLS/SSL termination at the load balancer. Is it possible to use the ip_hash directive to do sticky loadbalancing in combination with TLS/SSL termination? My application only uses HTTPS. I could not find…
Leo
  • 31
  • 1
  • 4
1
vote
0 answers

Apache reverse proxy sometimes takes over all requests

I am using my apache as a reverse proxy for a few requests to a webserver running on an internal port to allow access via my regular virtual host. This is on an ubuntu 15 running in vagrant. Here's my virtualhost config:
Christof
  • 121
  • 3
1
vote
0 answers

Configure a websocket server in front of HAProxy

I have a small python server script which creates a websocket connection and accepts base64 encoded IP packets (very similar to this). As of now my script decodes the IP packet and sends it out into the wild acting as a proxy. It attempts to…
Dan Ramos
  • 111
  • 3
1
vote
3 answers

Apache proxy all ws connections to different port

In my Apache 2.4 vhost I'm trying to get all https:// traffic to carry on to port 443, but all ws:// traffic to forward onto ws://*:6969. Eg: https://example.com/index would just go to https://example.com/index:443 as…
KapowKi
  • 11
  • 1
  • 3
1
vote
0 answers

How should I set up my sub-domain to allow it listen on a port for web socket transfer?

This may be a really beginner question, but I really want to make sure I'm going in the right direction before investing time in this. Heres what I have. charlieli.me @ 45.55.33.185:80 fileserver.charlieli.me @…
lzc
  • 111
  • 1
1
vote
1 answer

Apache wstunnel_proxy not working

I am trying to connect to my websocket server using html 5 websockets. The direct connection works fine, but when I try to hide my server behind apache proxy it does not work. it ends up: var ws = new…
Dusan Plavak
  • 143
  • 6
1
vote
1 answer

Nginx doesn't start Passenger/Nodejs

I cannot get Passenger to start my Nodejs (iojs) application on restarting nginx. I've followed the tutorials and installed the prerequisites: $ nginx -V nginx version: nginx/1.8.0 configure arguments: --with-cc-opt='-g -O2 -fstack-protector…
Maruf
  • 159
  • 9