Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Tunneling TCP in WebSocket

Project Description
Tunneling TCP connections in WebSocket to circumventing firewalls.
It’s light and can run on some PaaS (with SSL support).


  • Encryption
  • Proxy support (using HTTP CONNECT; test your proxy)
  • Display error message in browser (plain HTTP only)
  • SOCKS v5 and HTTP(S) in the same port (HTTP proxy is slower)

WARN: Do not rely it on security when not using SSL


wstan [-h] [-g] [-c | -s] [-d] [-z] [-p PORT] [-t TUN_ADDR]
      [-r TUN_PORT]
      [uri] [key]

positional arguments:
  uri                   URI of server
  key                   base64 encoded 16-byte key

optional arguments:
  -h, --help            show this help message and exit
  -g, --gen-key         generate a key and exit
  -c, --client          run as client (default, also act as SOCKS5/HTTP(S)
  -s, --server          run as server
  -d, --debug
  -y PROXY, --proxy PROXY
                        let client use a HTTPS proxy (host:port)
  -z, --compatible      useful when server is behind WS proxy
  -p PORT, --port PORT  listen port of SOCKS5/HTTP(S) server at localhost
                        (defaults 1080)
  -t TUN_ADDR, --tun-addr TUN_ADDR
                        listen address of server, overrides URI
  -r TUN_PORT, --tun-port TUN_PORT
                        listen port of server, overrides URI


# generate a key using "wstan -g"
wstan ws:// KEY -s  # server
wstan ws:// KEY  # client
# now a proxy server is listening at localhost:1080 (at client side)

Example for OpenShift with SSL:

wstan wss:// KEY -s -z -t $OPENSHIFT_PYTHON_IP -r $OPENSHIFT_PYTHON_PORT  # server
wstan wss:// KEY -z  # client
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wstan-0.3.1.tar.gz (53.4 kB) Copy SHA256 Checksum SHA256 Source Feb 12, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting