0

We are starting to develop a pushing solution between the client/browser and the FE server – the FE server is written on java. I am learning now this area and understood there are for now 4 main technologies used as can be seen under: What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?

I am trying to understand the SSE and web sockets technologies deeply but i found my self confused when it comes to websockets.

In a lot of articles i could found there are explanations why web-sockets are the technology i should really consider if i am looking for a Real time, two directional communications but in the other end i see that there are problems with websockets and proxy servers and security. Last article i found about it is from 2010 - http://www.infoq.com/articles/Web-Sockets-Proxy-Servers

But i guess things have changed from 2010 - Do someone can point me to updated solutions for those problems? point out other things i should be aware of?

Community
  • 1
  • 1
Oreli Levi
  • 71
  • 1
  • 4

1 Answers1

0

Not much really.

Some legacy proxies are still unaware of WebSockets connections. They remove the Upgrade header (because it is indicated in Connection) causing the HTTP negotiation to fail (or get just HTTP 200 rather than HTTP 101). Other proxies try to cache the response and reuse it for other clients, what makes no sense in WebSockets (clients will notice the issue when the response has the wrong sec-websocket-accept header's value).

Proxies are everywhere in the wild, placed by your ISP or your customers ISP, and there is nothing you can do to avoid them.

The solution is to use wss:// always. That way proxies are not a problem.

vtortola
  • 34,709
  • 29
  • 161
  • 263