Documentation
¶
Overview ¶
Package listen forwards live events to a local port.
The connection is opened OUTBOUND from this machine. That is what removes the need for a tunnel: no public URL, no inbound port, and it works behind NAT and corporate firewalls because it is an ordinary outgoing HTTPS connection.
Shape of the loop: create a session over HTTP, dial the socket, and for each frame that arrives POST it to the local target and report the result back up the socket. Reconnect with backoff when the socket drops, because laptops sleep, wifi flaps, and the server cycles connections on deploy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Green = "" Red = "" Yellow = "" Dim = "" Bold = "" Reset = "" )
Exported so other commands render the same way. They are set once in init(), after the NO_COLOR and terminal checks, so every command agrees on whether output is coloured rather than each deciding for itself.
Functions ¶
Types ¶
type Frame ¶
type Frame struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
AttemptID string `json:"attempt_id"`
EventID string `json:"event_id"`
EventType string `json:"event_type"`
Payload string `json:"payload"`
Timestamp int64 `json:"timestamp"`
Signature string `json:"signature"`
}
Frame is what the server pushes down the socket.