Documentation
¶
Overview ¶
Package server implements WireHop server admission and session ownership.
Index ¶
- Variables
- type Config
- type Server
- func (s *Server) Serve(parent context.Context, listener net.Listener) error
- func (s *Server) Snapshot() Snapshot
- func (s *Server) WebSocketConnContext(parent context.Context, connection net.Conn) context.Context
- func (s *Server) WebSocketHandler(ctx context.Context) http.Handler
- func (s *Server) WebSocketListener(listener net.Listener) net.Listener
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidConfig indicates missing authentication, policy, timing, or queue configuration. ErrInvalidConfig = errors.New("invalid server configuration") // ErrSessionLimit indicates that the server has reached its bounded session capacity. ErrSessionLimit = errors.New("server session limit reached") // ErrSessionIDCollision indicates that generated session identity was already retained. ErrSessionIDCollision = errors.New("generated session ID collision") )
var ( // ErrLaneLimit indicates that a session has reached its stable lane identifier limit. ErrLaneLimit = errors.New("session lane limit reached") // ErrSessionClosed indicates admission against a closing or expired session. ErrSessionClosed = errors.New("session closed") // ErrPathGroupMismatch indicates a stable lane identity changed its correlation group. ErrPathGroupMismatch = errors.New("lane path group changed") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Token []byte
Targets policy.TargetSet
Clock relay.Clock
WallClock func() time.Time
Logger *slog.Logger
Resolver target.Resolver
AuthenticationSkew time.Duration
HandshakeTimeout time.Duration
ReplayEntries int
JoinNonceEntries int
MaxSessions int
MaxLanesPerSession int
MaxPendingAdmissions int
ReconnectGrace time.Duration
IngressLimits packetqueue.Limits
LaneLimits packetqueue.Limits
RetentionLimits retention.Limits
Deadlines relay.DeadlinePolicy
DeduplicationWindow int
}
Config defines carrier admission and per-session resource limits.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server accepts authenticated carrier lanes and owns their relay sessions.
func (*Server) Serve ¶
Serve accepts binary stream carrier connections until context cancellation or listener failure.
func (*Server) Snapshot ¶
Snapshot returns bounded aggregate session and lane counts without credential material.
func (*Server) WebSocketConnContext ¶
WebSocketConnContext attaches a pre-header admission reservation to its HTTP connection context.
func (*Server) WebSocketHandler ¶
WebSocketHandler returns an HTTP handler for authenticated WebSocket creator lanes.
func (*Server) WebSocketListener ¶
WebSocketListener bounds TLS handshakes and HTTP header parsing with the shared admission limit. For WSS, apply this wrapper before the TLS listener so http.Server receives the resulting TLS connection directly.