How it Works
Portex is built as a distributed system that manages secure tunnels between your local development environment and our global gateway. Understanding the flow of data helps in debugging complex integrations.
System Components
The Agent (CLI)
Written in Go, the agent establishes a persistent WebSocket connection to our tunnel server. It serves as a bridge, forwarding incoming traffic to your local port.
Tunnel Server
Our high-performance Go-based gateway. It manages active connections, handles subdomain routing, and proxies requests in real-time with microsecond latency.
Backend (API)
A Laravel 12 application that handles user authentication, tunnel registration, and stores the activity logs you see in the dashboard.
The Gateway
Our edge servers handle SSL termination and PIN verification before traffic even touches the tunnel, ensuring only authorized requests reach your machine.
The Request Lifecycle
- Connection: When you run
portex start, the agent connects via Secure WebSockets (WSS) to our server. - Ingress: A visitor hits your public URL (e.g.,
myapp.portex.space). - Verification: The Portex Gateway checks if the tunnel is active and verifies any required PIN or authentication.
- Proxying: The request is encapsulated and sent through the WebSocket tunnel to your local agent.
- Execution: Your local server receives the request, processes it, and sends a response back through the same tunnel.
Infrastructure Safety
Every tunnel runs in an isolated context. We don't store your request/response bodies unless you are logged in and have enabled logging, and even then, they are stored securely and only accessible by you.