Documentation
¶
Overview ¶
Package anywhere implements the runtime side of Miren Anywhere, the connectivity feature that links a cluster to Miren Cloud's POP network for NAT traversal and inbound request forwarding.
This is the data plane: many HTTP/3-over-QUIC connections, one per (cluster, POP), optimized for bandwidth and latency and carrying public traffic into a NAT'd cluster. It is a tenant of the control-plane link in pkg/uplink, which it uses for exactly one thing: receiving the connection.request handshake that tells it to dial a POP.
Index ¶
Constants ¶
const TypeConnectionRequest = "connection.request"
TypeConnectionRequest is sent from cloud to cluster when a POP server needs the cluster to establish an HTTP/3 connection.
This is the one seam between Miren's two links: the data plane's setup handshake is delivered over the control plane. Everything else about POP connections happens on the data plane itself.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ClusterXID string
Ingress *httpingress.Server
Log *slog.Logger
// Uplink is the control-plane link this connector rides on. The connector
// registers its handler against it but does not own its lifecycle; whoever
// created the link runs it.
Uplink *uplink.Client
}
Config holds the configuration for the Miren Anywhere connector.
type ConnectionRequest ¶
type ConnectionRequest struct {
POPXID string `json:"pop_xid"`
POPAddress string `json:"pop_address"`
Hostname string `json:"hostname"`
RequestID string `json:"request_id"`
ConnectToken string `json:"connect_token"`
}
ConnectionRequest is the payload for connection.request messages.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector manages POP connections for inbound traffic forwarding.
type POPManager ¶
type POPManager struct {
// contains filtered or unexported fields
}
POPManager manages HTTP/3 connections to POP servers. When the cloud sends a connection.request, the manager establishes two QUIC connections to the POP:
- Control plane (ALPN "h3"): POST /connect with the connect_token
- Data plane (ALPN "pop-data"): authenticated by IP match, then serves incoming HTTP/3 requests forwarded by the POP
func NewPOPManager ¶
func NewPOPManager(clusterXID string, ingress *httpingress.Server, log *slog.Logger) *POPManager
NewPOPManager creates a new POP connection manager.
func (*POPManager) ConnectedPOPs ¶
func (m *POPManager) ConnectedPOPs() []string
ConnectedPOPs returns the XIDs of all currently connected POPs.
func (*POPManager) HandleConnectionRequest ¶
func (m *POPManager) HandleConnectionRequest(ctx context.Context, req ConnectionRequest) error
HandleConnectionRequest processes a connection.request from the cloud. It establishes connections to the specified POP if one does not already exist.
func (*POPManager) RemovePOP ¶
func (m *POPManager) RemovePOP(popXID string)
RemovePOP closes and removes the connection to a specific POP.