Skip to main content

This tool is for forwarding TCP or SOCK connections from one computer to another using a central web socket server.

Project description

Wultiplexor

What?

Wultiplexor is a reverse proxy server and client that uses websockets to multiplex tcp connections or unix sockets. You can use it to forward connections from one machine to another both behind NAT or firewall.

How?

Diagram

Why?

In the beginning, I had needed to redirect a unix socket for one specific application. Later I implemented this in a general way.

Deploy server using docker compose

docker network create wultiplexor
DOMAIN=wultiplexor.example.com ACME_EMAIL=acme@example.com SECRET=sEcReTkEy docker compose -p wultiplexor -f compose.yaml up --build -d

WARNING: The server is not intended to be used "as is" in a public accessible infrastructure. Use a reverse proxy like Traefik to secure the connection like I did in the compose.yaml file.

Install the client utility

pip install wultiplexor

Usage: Forward tcp port

  • On one machine, called the server or acceptor:
whannel ws://example.com/ acceptor -s sEcReTkEy localhost 8080 sEcReTGaTeWaYnAmeE
nc -l 8080
  • On another machine, called client or requestor:
whannel ws://example.com/ requestor sEcReTGaTeWaYnAmeE 9090
nc localhost 9090

And now you can chat between two machines.

Usage: Forward unix socket file

  • On one machine, called the server or acceptor:
whannel wss://example.com/ sock-acceptor -s sEcReTkEy ./server sEcReTGaTeWaYnAmeE
socat UNIX-LISTEN:./server,fork STDIO
  • On another machine, called client or requestor:
whannel wss://example.com/ sock-requestor sEcReTGaTeWaYnAmeE ./client
socat STDIO UNIX-CONNECT:./client

And now you can chat between two machines.

Mixed usage

You can mix unix sockets and tcp ports. To do that, use tcp-acceptor from one side and sock-requestor from the another. Or vice versa. This is also a way to "convert" a unix socket to a tcp port on the same machine.

Project details


Download files

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

Source Distribution

wultiplexor-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

wultiplexor-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file wultiplexor-0.1.0.tar.gz.

File metadata

  • Download URL: wultiplexor-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.12.2

File hashes

Hashes for wultiplexor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab20dc13866555fa98d6874c29bf6b19587bc5f4a3c1ce14293985a88877700f
MD5 4422ad4aa4ced2de818a7411cc989f52
BLAKE2b-256 f62fffe581cc7df6b66557b117ee5cec9d48290e98a4c5d4dc2ed441f1f7bd5a

See more details on using hashes here.

File details

Details for the file wultiplexor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wultiplexor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.12.2

File hashes

Hashes for wultiplexor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99b403defbb6917f41f4e87aa6988b9bde52d4aa2254c76d23c2b2de6186a7f0
MD5 e60594bca475aab96742dd1883557ae9
BLAKE2b-256 9c6aad6bef390679d3c8271842a4a1b5a2d788bb6873ade5560e8177d6a2aece

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page