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
0
votes
0 answers

How to limit the total volumn from a TCP connection

I have a particular application with one type of connection that mostly sends packets to clients while receives nothing but login request. (i.e. video streaming) Therefore I want to limit the Total Volumn Received from a TCP connection (websocket…
George Y
  • 380
  • 2
  • 11
0
votes
0 answers

SSL Error: How to use Nginx with Node.js App using Angular and websocket

I am running into an SSL error when setting up Nginx as a reverse proxy for a Node.js app. This app uses Angular to serve dynamic content and for WebSocket, we use ws. WS working properly but when attempting for wss I receive below error WebSocket…
user23316
  • 1
  • 1
0
votes
1 answer

How to create a websocket backend?

I'm getting clueless on this topic. I have a working websocket connection using Mosquitto on server_1 . The webapp that needs to publish the websocket data is in server_2 and is accessed behind a Nginx reverse proxy. Now, in LAN everything works…
glass
  • 25
  • 1
  • 4
0
votes
0 answers

WebSocket connection to 'wss:// failed: Error during WebSocket handshake: Unexpected response code: 404 on channels

I face this error while using channels for WebSockets on django production: WebSocket connection to 'wss://domain.me/ws/orders/confirm_all/' failed: Error during WebSocket handshake: Unexpected response code: 404 while there's no problem on…
MeHDI RH
  • 1
  • 1
  • 2
0
votes
0 answers

Laravel websockets package connection refused?

I using laravel websocket package aspusher replacement. First this ubuntu was not allowing to access the port 6001 then I add Inboud securoty group rule on aws . Now it is allowing to access the port but still not allowing to flow data thorug these…
0
votes
1 answer

Nginx socket reverse proxy got 503 responses on concurrent requests

I am using Nginx as a reverse proxy for my PHP base WebSocket application and I try to load test the WebSocket server with Nginx reverse proxy. And I got 503 errors when concurrent users reach around 1,000. But when I test the PHP application…
0
votes
1 answer

ActiveMQ Artemis: Propagate credentials from Websocket to STOMP

Can ActiveMQ Artemis propagate basic authentication information (username, password) from a Websocket to the encapsulated STOMP protocol (STOMP-over-Websockets)? The documentation does not really help here.
Stephan
  • 245
  • 1
  • 7
0
votes
0 answers

Apache Reverse Proxy and ShinyProxy

I wrote a shiny web application and deploy it on a server using ShinyProxy. Accessing the app directly via the IP address and port 8080 works fine. However, I need to connect it to a URL. On the ShinyProxy website there is an explanation on how it…
Chr
  • 103
  • 3
0
votes
1 answer

Asp.net core Blazor app with google authentication getting lots of websocket errors

We have a simple asp.net core 3.1 Blazor server-side app which we are trying to run on google app engine but are getting lots of websocket errors during initial connection: WebSocket connection to 'wss://[url]/_blazor?id=[id]' failed: Error during…
0
votes
1 answer

Nginx Config for ws://:

I have a domain i call it and ip call and port , i wan't using nginx on my server (dns binded to my server success), my problem is that reverse proxy ws:// protocole to my server i send my request in two…
Morteza j8
  • 103
  • 4
0
votes
0 answers

NGINX deny all except websockets for Flask app

I have an Ubuntu server running Flask app under nginx, this is my conf: upstream flaskapp { server 127.0.0.1:5000 fail_timeout=0; } server { listen 80; server_name _; location / { add_header "Access-Control-Allow-Origin"…
Igniter
  • 101
0
votes
1 answer

How can do Load Test against WebSocket?

We will have to do a load test for the first time. To tell the truth, I don't know exactly what to look for and how to do it. I have also researched resources on this subject but I could not obtain enough information on the internet and I wanted to…
eddiethedean
  • 1
  • 1
  • 1
0
votes
0 answers

Configure Apache Web Server (shared hosting) to provide simultaneous Web and Websocket Access

I'm trying since some days to find a way to configure simultaneous websocket and web server connections with one same Apache Web Server I have on a shared hosting basis. Now, before giving that up and definitely switching to a dedicated hosting…
DevelJoe
  • 103
  • 4
0
votes
1 answer

Configure NGINX Reverse Proxy in front of Apache Web Server (to enable websockets)

Upon recommendation of a member of the stackoverflow forum, I hereby ask the following question in this forum, where it apparently fits better (I'm new to this forum). What exactly I want: A specific page of my website should load its content…
DevelJoe
  • 103
  • 4
0
votes
1 answer

How to solve Nginx WebSocket secure (wss) "error 426 Upgrade Required"?

I tried to configure a Websocket proxy on my Nginx server, but unfortunately, I don't get it working. I have read various post here but I cannot get the server work. I think it has something to do between the client connection to the server. Local…
Dominique
  • 11
  • 3
1 2 3
12
13