8000 GitHub - ferama/pux: 🧡 Pux - A Lightweight, Async TCP Protocol Multiplexer in Rust (HTTP, HTTPS, SSH, RDP)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ pux Public

🧡 Pux - A Lightweight, Async TCP Protocol Multiplexer in Rust (HTTP, HTTPS, SSH, RDP)

License

Notifications You must be signed in to change notification settings

ferama/pux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧡 Pux β€” Protocol Multiplexer

Pux is a lightweight, asynchronous TCP protocol multiplexer written in Rust. It listens on a single port and forwards incoming connections to protocol-specific backend services by detecting the protocol in real time.

Supports:

  • 🧠 Protocol detection: HTTP, HTTPS (via TLS), SSH, RDP
  • πŸš€ Non-blocking, concurrent handling with tokio
  • πŸ” Deep protocol inspection (no reliance on port numbers)
  • πŸ“¦ Easy to configure with command-line arguments
  • 🧾 Logging via tracing

πŸ”§ How It Works

When a client connects to pux, the multiplexer:

  1. Peeks into the first packet sent by the client.
  2. Detects the protocol using pattern-based and TLS-based heuristics.
  3. Forwards the connection (including the already-received bytes) to the corresponding backend.
  4. Pipes traffic bidirectionally for the life of the connection.
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚   Client    β”‚
                          β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                      TCP Connection to pux Port 5500 (or any, 443?)
                                β”‚
                                β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚    Pux        β”‚
                         β”‚ (Multiplexer) |
                         β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚              β”‚              β”‚              β”‚              β”‚
 β–Ό              β–Ό              β–Ό              β–Ό              β–Ό
SSH           HTTPS           HTTP           RDP         Unknown
"SSH-"       TLS Hello      GET/POST...    RDP SYN       Fallback
banner       w/ SNI          Methods       Packet

 β”‚              β”‚              β”‚              β”‚
 β–Ό              β–Ό              β–Ό              β–Ό
127.0.0.1:22  127.0.0.1:443  127.0.0.1:80  192.168.1.2:3389

  SSH         HTTPS         HTTP         RDP
 Server       Server       Server       Server

🏁 Quick Start

Build

cargo build --release

Run

./pux \
    --listen 0.0.0.0:9999 \
    --http 127.0.0.1:8080 \
    --https 127.0.0.1:8443 \
    --ssh 127.0.0.1:2222 \
    --rdp 127.0.0.1:3389

Only the protocols you specify will be enabled. At least one backend is required.

πŸ›  CLI Options

Option Description Required
--listen Address and port to listen on βœ… Yes
--fallback Fallback Backend (for undetected/unknown protocol) Optional
--http Backend for HTTP clients Optional
--https Backend for HTTPS (TLS) clients Optional
--ssh Backend for SSH clients Optional
--rdp Backend for RDP clients Optional

βœ… At least one backend must be configured.

πŸ“¦ Example Use Case

Run Pux on the default RDP port (3389) and forward SSH, HTTP, or RDP clients to their correct backend automatically.

πŸ§ͺ Testing

Try with curl, ssh, or an RDP client pointed at your mux port:

curl http://localhost:9999
ssh -p 9999 user@localhost

πŸ›‘οΈ Security

Pux doesn’t terminate TLS or SSH; it simply forwards traffic after protocol detection. That means end-to-end encryption is preserved.

πŸ“„ License

MIT

πŸ’‘ Name Origin

Pux = Protocol muxer. Short, fast, and to the point β€” like the tool itself.

About

🧡 Pux - A Lightweight, Async TCP Protocol Multiplexer in Rust (HTTP, HTTPS, SSH, RDP)

Topics

Resources

License

Stars

Watchers

Forks

3EE7

Contributors 2

  •  
  •  

Languages

0