New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of suggestions for the WebSocket page #47

Open
miguelgrinberg opened this Issue Jan 25, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@miguelgrinberg

miguelgrinberg commented Jan 25, 2015

Overall the content is very good (as usual). But I have a few small corrections:

  • The WebSocket diagram shows only server-push, but that is half of what you can do (as you correctly indicate in the description above). I think it would be good to add independent arrows that go from client to server, to indicate that both the client and the server can freely initiate an exchange at any time.
  • The following sentence is incorrect with respect to the client-side:

Both a JavaScript library on the web browser and a WebSockets implementation on the server are necessary to establish and maintain the connection between the client and server.

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 WebSocket object.

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.

  • WebSocket friendly servers for Python

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.

@mattmakai

This comment has been minimized.

Owner

mattmakai commented Jan 28, 2015

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.

mattmakai added a commit that referenced this issue Feb 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment