Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Couple of suggestions for the WebSocket page #47
Comments
|
Definitely agree on all these points @miguelgrinberg. Working on a couple of updates to the page I think will clarify, especially the point about needing a JS library instead of the libraries just exposing the browser API in a more developer-friendly cross-browser way. |
Overall the content is very good (as usual). But I have a few small corrections:
There is native support for the WebSocket protocol in most browsers. In many cases clients use a wrapper library, but that is technically not required, as browsers expose the
WebSocketobject.I think that either here in this place, or later in the document you have to describe Socket.IO as pair of client and server libraries that wrap WebSocket. The nice thing about Socket.IO is that if you run it on a browser that doesn't have native WebSocket support, it can emulate the real-time communication using long polling or other methods and the implementation differences are hidden by the library. The important point here is that WebSocket != Socket.IO, which I think is not totally clear now.
A discussion on how to support WebSocket server-side is missing. You mention gevent a couple of times, but I think it would be helpful to discuss the implications of WebSocket on the server. Something on the lines of: since the connection is long lived, a multi-threaded or multi-process based server cannot scale appropriately, so you need an asynchronous server such as gevent for any practical implementation.