Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will html5 websockets be crippled by firewalls?

I'm extremely excited about html5's websockets spec but I have a concern.

These days everyone is operating off of some network, with routers (wired/wireless) that have built in firewalls, windows has a built in firewall too.

With that in mind when the server attempts to connect back to the browser that started the websocket handshake will it fail for the vast majority of users? (most people have no idea how to set up port forwarding on their routers)

Or is my thinking incorrect and it will go through fine?

like image 261
Travis Avatar asked Dec 28 '09 04:12

Travis


People also ask

Are WebSockets blocked by firewall?

WebSocket connections generally work even if a proxy or firewall is in place. This is because they use ports 80 and 443 which are also used by HTTP connections.

Can WebSockets be blocked?

If Grok is telling you that WebSockets are blocked, this usually happens because your school or device is blocking WebSockets.

Are WebSockets a security risk?

Some WebSockets security vulnerabilities arise when an attacker makes a cross-domain WebSocket connection from a web site that the attacker controls. This is known as a cross-site WebSocket hijacking attack, and it involves exploiting a cross-site request forgery (CSRF) vulnerability on a WebSocket handshake.

What will replace WebSockets?

For applications that need low-latency, event-driven communication between endpoints, WebSockets has been the go-to choice, but WebTransport may change that. WebSockets is a technology that enables bidirectional, full-duplex communication between client and server over a persistent, single-socket connection.


2 Answers

I'm not an expert (so please check to confirm) but I believe there will be an UPGRADE mechanism where a regular HTTP connection can be made, then upgraded to a WebSocket, so no existing firewall rules interfere unless they are doing aggressive application level packet inspection. Connections are still initiated by the browser.

like image 173
Mark Renouf Avatar answered Sep 30 '22 17:09

Mark Renouf


HTML 5 WebSockets don't require port forwarding. Connections continue to be established from the client, but the client and server asymmetry disappears once the connection is established. WebSockets also punch through proxies by using the same CONNECT mechanism that HTTPS uses today.

like image 36
Marcelo Cantos Avatar answered Sep 30 '22 17:09

Marcelo Cantos