Port Assignment
How Exposr assigns public ports for tunnels.
Automatic assignment
When no public port is specified, Exposr automatically assigns one:
- First, try port
25565 - If taken, pick a random port from
20000–30000 - Send the port to the server for registration verification
- If the server confirms it's available, use it
- If not, try another random port (up to 100 attempts)
bash
# Automatic port assignment
exposr expose 3000Explicit assignment
You can request a specific public port with the to keyword. Exposr requests that exact port without fallback:
bash
# Request specific public port 21342
exposr expose 3000 to 21342Assignment algorithm
text
25565
|
v
available?
|
+-- yes -> register tunnel
|
+-- no
|
v
random port from 20000-30000
|
v
available?
|
+-- yes -> register tunnel
|
+-- no -> try another random port (up to 100 attempts)Random ports are verified with the server — a port is not assumed available just because it was randomly selected.