You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>WebSockets allow two-way communication between the client and server.
4600
+
A WebSockets-enabled application allows a web server to push data to a web
4601
+
browser without the browser having to poll for updates via HTTP. Allowing
4602
+
push from the server to the client and vice versa is much more efficient than
4603
+
having the client constantly ask the server "are there any updates?".</p>
4604
+
<p>Previous approaches for for keeping a connection alive between client and
4605
+
server over HTTP, such as
4606
+
[Comet](http://en.wikipedia.org/wiki/Comet_(programming), have either used
4607
+
long polling or were not implemented by all browsers.</p>
4608
+
<h2>JavaScript client libraries</h2>
4609
+
<ul>
4610
+
<li>
4611
+
<p><ahref="http://socket.io/">Socket.io</a>'s client side JavaScript library can be
4612
+
used to connect to a server side WebSockets implementation.</p>
4613
+
</li>
4614
+
<li>
4615
+
<p><ahref="https://github.com/gimite/web-socket-js">web-socket-js</a> is a Flash-based
4616
+
client-side WebSockets implementation.</p>
4617
+
</li>
4618
+
</ul>
4619
+
<h2>WebSockets resources</h2>
4620
+
<ul>
4621
+
<li>
4622
+
<p>The official W3C
4623
+
<ahref="http://www.w3.org/TR/websockets/">candidate draft for WebSockets API</a>
4624
+
and the
4625
+
<ahref="http://dev.w3.org/html5/websockets/">working draft for WebSockets</a> are
4626
+
good reference material but can be tough for those new to the WebSockets
4627
+
concepts. I recommend reading the working draft after looking through some
4628
+
of the more beginner-friendly resources list below.</p>
4629
+
</li>
4630
+
<li>
4631
+
<p>Mozilla's
4632
+
<ahref="https://developer.mozilla.org/en-US/docs/WebSockets">Developer Resources for WebSockets</a>
4633
+
is a good place to find documentation and tools for developing with
4634
+
WebSockets.</p>
4635
+
</li>
4636
+
<li>
4637
+
<p><ahref="http://mrjoes.github.io/2013/06/21/python-realtime.html">Real-time in Python</a>
4638
+
provides Python-specific context for how the server push updates were
4639
+
implemented in the past and how Python's tools have evolved to perform
4640
+
server side updates.</p>
4641
+
</li>
4642
+
<li>
4643
+
<p>The <ahref="https://www.twilio.com/blog/2014/11/choose-your-own-adventure-presentations-with-reveal-js-python-and-websockets.html">Choose Your Own Adventure Presentations</a>
4644
+
tutorial uses WebSockets via gevent on the server and socketio.js for
4645
+
pushing vote count updates from the server to the client. </p>
4646
+
</li>
4647
+
</ul>
4648
+
<h3>What's next for your web application after setting up WebSockets?</h3>
0 commit comments