anywhere

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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

View Source
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.

func New

func New(cfg Config) *Connector

New creates a Connector and registers its connection.request handler on the uplink. The caller is responsible for running the uplink itself.

func (*Connector) Close added in v0.14.0

func (c *Connector) Close()

Close tears down POP connections.

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:

  1. Control plane (ALPN "h3"): POST /connect with the connect_token
  2. 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) Close

func (m *POPManager) Close()

Close shuts down all POP connections.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL