Sign in

    tun-poc-server

    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    6 months ago
    Downloads
    128

    #tun-poc-server

    The server agent for tun-poc. Runs on the machine you want to expose, opens a single outbound WebSocket to a relay, and spawns a PTY per incoming session so clients get a real shell.

    No inbound ports are required — it works behind home routers, corporate firewalls, and carrier-grade NATs.

    Responsibilities:

    • Register with the relay and accept sessions keyed by ServerId.
    • Fork a PTY per session (pty/, tty/) and stream I/O both ways.
    • Keep the local shell alive across relay disconnects and reattach on reconnect.
    • Resolve XDG paths for scoped credential storage (xdg/).

    #Run

    # connect to the hosted relay moon run server --target native # expose a specific program instead of the default shell moon run server --target native -- /bin/bash moon run server --target native -- -- htop # point at a self-hosted relay moon run server --target native -- --relay your.relay.example.com

    The agent prints the ServerId it registered under — keep the process running for the session to stay reachable.

    GetcwdFailed

    pub suberror GetcwdFailed derive(
    Debug
    )

    Raised by getcwd when @env.current_dir() returns None. In practice a process without a valid cwd cannot run, so this is effectively unreachable — the suberror exists so callers can depend on a String rather than String?.

    getcwd

    fn getcwd() -> String raise GetcwdFailed

    Returns the server process's current working directory. Thin wrapper around @env.current_dir(), which reads the kernel's cwd via POSIX getcwd(2). The wrapper exists so callers can depend on a String rather than String?.

    Source Files