Server Architecture

Internal structure of the Exposr relay server.

File structure

  • server
    • __init__.py
    • control.py
    • data.py
    • tunnel.py
    • ports.py
    • main.py

Modules

main.py

Server entry point. Starts the control and data listeners.

control.py

Control channel handler. Accepts agent connections on port 9000, validates tokens, processes REGISTER requests, and sends CONNECT notifications.

data.py

Data channel handler. Accepts data connections on port 9001, matches UUIDs, and bridges data connections with public client sockets.

tunnel.py

Tunnel management. Tracks active tunnels, maps public ports to agents, and handles cleanup on disconnection.

ports.py

Port management. Tracks port ownership, handles registration, and releases ports when agents disconnect.