Skip to content

Relay Mode

Chokri Hammedi edited this page Aug 2, 2026 · 1 revision

Relay Mode

Relay mode connects two endpoints and moves bytes in both directions:

wcat relay [options] LEFT RIGHT

Endpoint Grammar

-                    standard input/output
stdio                standard input/output
tcp:HOST:PORT        outbound TCP connection
listen:HOST:PORT     inbound TCP listener, accepts one peer
unix:PATH            outbound Unix domain socket connection
unix-listen:PATH     inbound Unix domain socket listener, accepts one peer
file:PATH            read/write file endpoint, created if missing
exec:PATH            process endpoint using pipes
pty:PATH             process endpoint using a POSIX PTY

Rules

  • HOST may be an IPv4 address, IPv6 address, or resolvable hostname.
  • PORT must be numeric, from 1 to 65535.
  • listen:HOST:PORT accepts one connection for the relay session.
  • unix:PATH and unix-listen:PATH use stream Unix domain sockets.
  • exec:PATH and pty:PATH execute the path directly; shell parsing is not applied.
  • pty:PATH is intended for interactive programs that expect terminal behavior.
  • file:PATH opens the file read/write and creates it with mode 0600 when it does not exist.

Examples

Standard input/output to TCP:

wcat relay - tcp:example.com:80

Local listener to remote TCP:

wcat relay listen:127.0.0.1:9000 tcp:10.0.0.5:22

Unix socket to process:

wcat relay unix-listen:/tmp/wcat.sock exec:/usr/bin/tee

Process relay:

wcat relay - exec:/usr/bin/tee

Capture TCP traffic to a file:

wcat relay tcp:127.0.0.1:9000 file:./capture.bin

PTY-backed shell relay:

wcat relay listen:0.0.0.0:4444 pty:/bin/sh

Hex inspection with timeout:

wcat relay --hex --timeout 10 tcp:127.0.0.1:8000 file:./trace.bin

Clone this wiki locally