Popular recipes tagged "websocket"http://code.activestate.com/recipes/tags/websocket/2015-06-30T03:37:19-07:00ActiveState Code RecipesSimple Web socket client implementation using Tornado framework. (Python)
2015-06-30T03:37:19-07:00Vovanhttp://code.activestate.com/recipes/users/4192447/http://code.activestate.com/recipes/579076-simple-web-socket-client-implementation-using-torn/
<p style="color: grey">
Python
recipe 579076
by <a href="/recipes/users/4192447/">Vovan</a>
(<a href="/recipes/tags/client/">client</a>, <a href="/recipes/tags/tornado/">tornado</a>, <a href="/recipes/tags/web/">web</a>, <a href="/recipes/tags/websocket/">websocket</a>, <a href="/recipes/tags/websockets/">websockets</a>).
</p>
<p>Simple Web socket client implementation using Tornado framework.</p>
WebSocket interface (Python)
2012-11-25T16:52:21-08:00Nick Farohttp://code.activestate.com/recipes/users/4184363/http://code.activestate.com/recipes/578348-websocket-interface/
<p style="color: grey">
Python
recipe 578348
by <a href="/recipes/users/4184363/">Nick Faro</a>
(<a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/socket/">socket</a>, <a href="/recipes/tags/websocket/">websocket</a>).
Revision 2.
</p>
<p>This tries its best to be a replacement for the regular <code>socket</code> module.</p>
<p>It supports only sending and receiving but should be useful enough.</p>
<p>The only real difference should be that you can't specify the number of bytes is received, instead do</p>
<pre class="prettyprint"><code>for message in socket.recv():
print(message)
</code></pre>
<p>Revision 2:
Added proper message receiving. Previously it just requested a ton of data. Now it reads 2 bytes, determines the length, then requests that much.</p>