Websockify bridges WebSocket clients to plain TCP services so browsers can talk to existing servers. It originated as part of the noVNC effort.
Overview
Websockify accepts a WebSocket handshake from a client, then forwards traffic between that client and a target TCP host and port. The basic role is translating WebSocket traffic to normal socket traffic in both directions.
The proxy supports HyBi / IETF 6455 WebSocket binary mode. Optional TLS (wss://) uses certificate and key files, with guidance for self-signed and chained commercial certificates. It can run as a daemon, detect SSL automatically, record sessions, serve static files on the same port, wrap local programs, log to a file, and use authentication and token plugins for routing clients to different targets.
A program-wrap mode launches a local command and proxies WebSocket traffic to its TCP port using an LD_PRELOAD library that rebinding binds. Python is the primary implementation; sister projects offer JavaScript and other language ports.
Installation is via Python setuptools or OCI container images with port mappings and volume mounts for web roots and certificates. It is commonly paired with browser VNC clients such as noVNC.
Key features
- Bidirectional WebSocket to TCP forwarding
- Optional wss:// with custom certificates
- Daemon and session recording modes
- Mini web server on proxy port
- Token-based multi-target routing
- Local program wrap with bind redirection
- Docker and Podman container images
- Authentication plugins for connections
Use cases
- Browser access to VNC or telnet services
- Exposing legacy TCP apps to web clients
- noVNC and remote desktop over WebSockets
- TLS-terminated WebSocket proxies