docs: http-lp forwarding goes over the agent's WebSocket, by long polls only without one - said so in the panel, the code and the README

This commit is contained in:
redtea committed 2026-10-16 21:56:24 +03:00
1 parent e93a2bbd3a
commit e8d45f2f7b
7 files changed
+22 -15

No files matched your search

+6 -5
View File
@@ -1,8 +1,8 @@
// Package proto describes the wire messages shared by the server and the agent.
//
// All agent<->server traffic is plain JSON over HTTP(S) long-polling so it
// survives NAT and restrictive egress firewalls: the agent only ever makes
// outbound requests.
// All agent<->server traffic is plain JSON, on a WebSocket the agent opens or,
// where that does not get through, over HTTP(S) long polls, so it survives
// NAT and restrictive egress firewalls: the agent only ever connects out.
package proto
import "strings"
@@ -11,7 +11,7 @@ import "encoding/json"
// Control poll message types (server -> agent, returned from /api/agent/poll).
const (
// CtrlIdle is returned when the long-poll times out with nothing to do.
// CtrlIdle is returned when the control poll times out with nothing to do.
CtrlIdle = "idle"
// CtrlOpenTerminal tells the agent to spawn a PTY for the session id.
CtrlOpenTerminal = "open_terminal"
@@ -56,7 +56,8 @@ type EnrollResponse struct {
Token string `json:"token"`
}
// ControlMessage is the body returned by the control long-poll.
// ControlMessage is a command for the agent: on the WebSocket, or the body of
// the control long poll.
type ControlMessage struct {
Type string `json:"type"`
SessionID string `json:"session_id,omitempty"`