exposr tcp and udp
Expose a local TCP or UDP service through an Exposr relay server.
Usage
bash
exposr tcp <local-port> [public-port]
exposr udp <local-port> [public-port]bash
exposr tcp <local-port> [public-port]
exposr udp <local-port> [public-port]Arguments
| Argument | Required | Description | |
|---|---|---|---|
| <local-port> | Yes | The local port to forward traffic to | The local TCP or UDP port to forward traffic to |
| [public-port] | [public-port] | No | Specific public port to request |
Options
| Option | Default | Description |
|---|---|---|
| --server-host | Saved config | Override the relay server address |
| --control-port | 9000 | Control channel port on the server |
| --data-port | 9001 | Data channel port on the server |
| --local-host | 127.0.0.1 | Local host to forward to |
Port assignment
When no public port is specified, Exposr tries port 25565 first. If unavailable, it picks random ports from 20000-30000 and checks each with the server, up to 100 attempts.
When a public port is explicitly specified, Exposr requests that exact port without fallback. TCP and UDP tunnels use separate public sockets. When a public port is explicitly specified, Exposr requests that exact port without fallback. TCP and UDP tunnels use separate public sockets.
Examples
bash
# Expose local port 3000 with automatic port assignment
# Expose local TCP port 3000 with automatic port assignment
exposr tcp 3000
# Expose local TCP port 3000 on public port 21342
exposr tcp 3000 21342
# Expose local UDP port 3000 on public port 21342
exposr udp 3000 21342
# Expose local port 8080
exposr tcp 8080
# Expose Minecraft server
exposr tcp 25565
# Override server address for one run
exposr tcp 3000 --server-host 10.0.0.5Output
On successful connection, Exposr displays:
exposr
[TRYING] Connecting to Exposr server [CONNECTED] Connected to Exposr control server [TRYING] Registering public port [CONNECTED] Tunnel active Public address: 20.198.81.254:25565 Forwarding to: 127.0.0.1:3000
Errors
If the server is not configured:
text
[ERROR] Server IP is not configured. Run: exposr config set-server <server-ip>Tip
Run
exposr config set-server YOUR_SERVER_IP to save the server address before using expose. Run exposr config set-server YOUR_SERVER_IP to save the server address before using tcp or udp.