Files
archie/internal/app/agentworker/relay.go
T
sam 4fc06b5d7d feat(egress): relay forwarding a sandbox network to the egress proxy
archie-agent relay listens on the sandbox's isolated network and joins
every connection to one fixed target, the proxy. The relay holds no
secrets and can reach nothing else, so the host needs no address on a
sandbox network at all.
2026-09-26 02:33:41 +10:00

19 lines
443 B
Go

package agentworker
import (
"context"
"net"
"github.com/samcharles93/archie-core/internal/infrastructure/egress/relay"
)
// RunRelay listens on listen and forwards every connection to target, the
// egress proxy, until ctx is cancelled.
func RunRelay(ctx context.Context, listen, target string) error {
ln, err := (&net.ListenConfig{}).Listen(ctx, "tcp", listen)
if err != nil {
return err
}
return relay.Serve(ctx, ln, target)
}