Websockets and scalability

1) Single server instance and single client ==> How many websockets will be created and how many connections to websockets? If your client creates one webSocket connection, then that’s what there will be one webSocket connection on the client and one on the server. It’s the client that creates webSocket connections to the server so … Read more

Differences between ZeroMQ and WebSockets

A: Real-Time-Messaging is a nice tag, however You may soon realise, that once going into the territory of Real-Time, there is no justification for spending clock-cycles on wrapping any message into the XHTML-Matrjoska-in-Another-Matrjoska-inside-another-Matrjoska alike envelopes-inside-envelopes and associated inefficiencies. Real-Time struggles to operate in real time, so to spend/lose a minimum achievable time necessary to process … Read more

Describe websocket api via Swagger

It seems to be possible using swagger-socket. Still, it seems that only a Java/Scala server implementation exists for now, which means they are not as much codegens for this that there is for “standard” Swagger REST services. Edit: As pointed out, this project seems to be dead. Unfortunately at the time of updating this answer, … Read more

What is the difference between WebRTC and WebSockets for low level data communication

There is one significant difference: WebSockets works via TCP, WebRTC works via UDP. In fact, WebRTC is SRTP protocol with some additional features like STUN, ICE, DTLS etc. and internal VoIP features such as Adaptive Jitter Buffer, AEC, AGC etc. So, WebSockets is designed for reliable communication. It is a good choice if you want … Read more

Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint

Update (November 2016): The information provided in this answer is for the JSR356 spec, individual implementations of the spec may vary outside of this information. Other suggestions found in comments and other answers are all implementation specific behaviors outside of the JSR356 spec. If the suggestions in here are causing you problems, upgrade your various … Read more

How to do load testing for websockets [closed]

I can give you a suggestion from my recent experience. You can connect webkit based Phantom virtual clients to your chat server and measure the resource usage (i.e CPU, memory, may be using a shell script or another utility or you can profile your service ) var system = require(‘system’); var page = require(‘webpage’).create(); page.viewportSize … Read more

What is Sec-WebSocket-Key for?

According to RFC 6455 Websocket standard first part: .. the server has to prove to the client that it received the client’s WebSocket handshake, so that the server doesn’t accept connections that are not WebSocket connections. This prevents an attacker from tricking a WebSocket server by sending it carefully crafted packets using XMLHttpRequest [XMLHttpRequest] or … Read more