This is a client for the Websocket protocol (IETF RFC6455) for the Twisted framework.

See for the specifications of the protocol.


Trial (Twisted unit testing suite)

The trial tests require a version of txwebsocket that can be found at:

Run them with: trial test_websocket_client


The Autobahn test suite is used as third party reference point. These tests are also more functional than the Trial based ones.

  1. Get and install Autobahn (

  2. Start the Autobahn test suite server ( is located in the source of Autobahn, in the testsuite/websockets directory):

  3. Run:

    • a specific test case (1):

      python ./ -c1
    • a bunch of tests (16) starting at (1):

      python ./ -c1 -n 16
    • complete test suite:

      python ./ -a
    • update the report:

      python ./ -u
    • a quick help:

      python ./ -h
  4. Check the report at http://localhost:9090/reports/clients/index.html

NOTE: Currently the tests that should handle UTF-8 decoding errors are failing.


TODO: Refer to the for a sample usage.

Many thanks

  • to Rlotun and the other contributors for the txWebsocket server (
  • to Tobias Oberstein (Tavendo GmbH) for the Autobahn test suite
  • to milutz for wss/TLS bug report and fix
  • to the many people contributing to the Twisted framework
  • to the many people contributing to the Python language
  • to the many people who have contributed to the definition of the Websocket protocol
  • anyone who will contribute to the improvement of this software :)


  • Additional testing for the UTF-8 decoding
  • Extensions/subprotocols


This software is released under the same terms than the Twisted license. See the LICENSE file distributed with this software.