Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python
branch: master

This branch is 2 commits behind ustudio:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
README.md
setup.py
tornado_websocket_client.py

README.md

Websocket client for protocol version 13 using the Tornado IO loop.

http://tools.ietf.org/html/rfc6455

import websocket

class HelloSocket(websocket.WebSocket):

    def on_open(self):
        self.write('hello, world')

    def on_message(self, data):
        print data

    def on_ping(self):
        print 'I was pinged'

    def on_pong(self):
        print 'I was ponged'

    def on_close(self):
        print 'Socket closed.'


ws = HelloSocket('ws://echo.websocket.org')
ws.connect()
Something went wrong with that request. Please try again.