rembrembdocs

Architecture

Understanding how OutRay works under the hood

OutRay is designed to be simple yet robust.

The OutRay system consists of three main components:

  1. The Client (CLI): Runs on your local machine.

  2. The Tunnel Server: Runs in the cloud (or your server) and acts as the bridge.

  3. The Web Dashboard: Manages users, organizations, and configurations.

  4. Initialization: When you run outray 3000, the CLI initiates a WebSocket connection to the Tunnel Server.

  5. Authentication: The server verifies your identity using the token provided during login or via the --key flag.

  6. Tunnel Establishment: Once authenticated, the server assigns a public URL (e.g., https://random.tunnel.outray.app) to your connection.

  7. Request Handling:

    • A visitor accesses the public URL.
    • The Tunnel Server receives the request.
    • The server forwards the request payload over the WebSocket connection to the CLI.
    • The CLI proxies the request to your local server (e.g., localhost:3000).
    • Your local server responds.
    • The CLI sends the response back through the WebSocket to the Tunnel Server.
    • The Tunnel Server sends the response to the visitor.