Reference applications that use WebSocket

Hey
I am trying to research a bit about the differences between traditional web applications and modern web applications.

Web applications in the past were usually based entirely on hyperlinks. You interacted with the page, the browser sent a HTTP request and you received a new rendered HTML-Page that was dynamically rendered on the server with a script-language like php. These applications felt slow, non-intuitive and not really dynamic, because everything was done on the server.
With the introduction of AJAX (short for asynchronous JavaScript and XML) it has been possible to send HTTP requests to the server without reloading the page. Web applications could have been a lot more dynamic through receiving data from the server on the fly. AJAX revolutionized the web.
Here at meteor we are using WebSocket through sock.js, which contains fallbacks if your browser does not support WebSocket (WebSocket is supported in all major browsers, but was standardized in 2011 and is quite young). The advantages of WebSocket are that you have a bidirectional way to communicate between the server and the client and that you can just send messages through the socket once the connection is established. There is not the need to send the HTTP headers and overhead. That makes them fast in theory, ideal for real-time collaborative applications or games.

In theory WebSockets are really cool. There are so many blog posts about them, but it feels actually hard to find real-world applications (apart from meteor applications) that use them.
I don’t know any large and well-known application that is based on WebSocket. I thought that large apps like Google Docs are utilizing WebSocket, but my network panel in chrome devtools shows only XMLHttpRequests instead of a websocket connection.
I read about some twitter clients are utilizing websockets, but did not find any further evidence.
I found a blog post about trello and that it utilizes WebSocket, but my network profiler doesn’t show a WebSocket connection here as well.

I went to some meteor applications. Actually when I open the todos-app, the network panel shows a websocket connection. Also when visiting a demo wekan. But when I tried to visit a larger application like codefights, there are again only XMLHttpRequests. But why? I assume sock.js (sock.js seems to be active because the application is completely reactive and working; also https://codefights.com/sockjs shows up the welcome message) utilizes a fallback instead of WebSocket. Perhaps because they are using Cloudflare and there are some issues with WebSocket, see a similiar thread about disabling websockets: Is disabling Websockets bad? (Cloudflare). But actually I don’t know.

Meteor DDP trough Websockets in the Chrome Network Panel:

Meteor DDP through XMLHttpRequests in the Chrome Network Panel:

Yeah. Are there really so few sites that are based on WebSocket (or do they actually utilize a fallback)? I’m hoping that someone can help me to find real-world applications that prove the opposite.
When I can write about the advantages of using WebSockets (and prove them with good reference applications) instead of classical AJAX, I will have a big argument why web apps that use WebSocket are superior and the future. And that would mean that meteor is a good choice for building the future.

Thanks for your help,
Vailfire

1 Like

Hi, @Vailfire, interesting question! I’m also learning about the difference between http and websockets. Do check out this great book and this Quora thread. I think they are helpful.

1 Like