Documentation
¶
Index ¶
Constants ¶
View Source
const ( SocketCodeUnknownProtocol = 3000 SocketCodeExcessTraffic = 3001 SocketCodeBadCallId = 3002 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveCall ¶
type ActiveCall interface {
// SessionID returns the globally unique ID for this session in this process.
// It is always an unsigned int safe for use in JavaScript.
SessionID() int
// ReadJSON reads JSON for the call into the given pointer.
ReadJSON(v any) error
// WriteJSON writes JSON from the given pointer to the call.
WriteJSON(v any) error
}
type CallHandler ¶
type CallHandler func(context.Context, ActiveCall) error
CallHandler is invoked for each new remote call.
type Handler ¶
type Handler struct {
Handler CallHandler
// SkipOriginVerify allows any hostname to connect here, not just our own.
SkipOriginVerify bool
// CallLimit optionally limits the number of calls allowed by a single session.
// This is probably just each WebSocket connection.
// A session will be killed if it exceeds this rate; the client must know it too.
CallLimit *LimitConfig
// PacketLimit optionally limits the number of packets allowed across all calls.
// This includes call setup/metadata packets.
// A session will be killed if it exceeds this rate; the client must know it too.
PacketLimit *LimitConfig
// contains filtered or unexported fields
}
Handler describes a call handler type that can be served over HTTP.
type LimitConfig ¶
Click to show internal directories.
Click to hide internal directories.