Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateWebSocketOptions ¶
type CreateWebSocketOptions struct {
Version string
Domain string
Port int
Secure bool
Token types.GetToken
Notification *Notification
// PublicHTTPNoAuthSessionTTL: max lifetime for unauthenticated (public) monitor clients only.
// YAML key is historical. Zero means use default (10m). Not based on HTTP tunnel or edge auth.
PublicHTTPNoAuthSessionTTL time.Duration
// PublicHTTPNoAuthWarnLeadTime: how long before expiry to send warn. Zero means default (2m).
PublicHTTPNoAuthWarnLeadTime time.Duration
}
CreateWebSocketOptions contains options for creating WebSocket monitor
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
EventEmitter emits events
func NewEventEmitter ¶
func NewEventEmitter() *EventEmitter
NewEventEmitter creates a new event emitter
func (*EventEmitter) Emit ¶
func (e *EventEmitter) Emit(event string, data interface{})
Emit emits an event
func (*EventEmitter) On ¶
func (e *EventEmitter) On(event string, handler func(interface{}))
On registers an event handler
type MonitorChannelHandler ¶
type MonitorChannelHandler struct {
// contains filtered or unexported fields
}
MonitorChannelHandler handles monitor channel connections
func NewMonitorChannelHandler ¶
func NewMonitorChannelHandler(ctx *types.Context, options *CreateWebSocketOptions, emitter *EventEmitter) *MonitorChannelHandler
NewMonitorChannelHandler creates a new monitor channel handler
func (*MonitorChannelHandler) HandleConnection ¶
func (h *MonitorChannelHandler) HandleConnection(w http.ResponseWriter, r *http.Request)
HandleConnection handles a new protocol monitor channel WebSocket connection (/_/monitor) New protocol: monitor channel handles ping/pong, auth, control messages (tcp:data goes to data channel)
func (*MonitorChannelHandler) HandleConnectionLegacy ¶
func (h *MonitorChannelHandler) HandleConnectionLegacy(w http.ResponseWriter, r *http.Request)
HandleConnectionLegacy handles a legacy protocol WebSocket connection (/_client) Legacy protocol: single connection handles all messages including tcp:data
type Notification ¶
type Notification struct {
// contains filtered or unexported fields
}
Notification represents notification service
func NewNotification ¶
func NewNotification(config *client.NotificationConfig) *Notification
NewNotification creates a new notification instance
type WebSocketConnection ¶
type WebSocketConnection struct {
*websocket.Conn
// RequestHost is the HTTP Host from the WebSocket upgrade (host only, no port). Used to build
// authenticate response URL when server Domain option is empty.
RequestHost string
ContainerID string
ClientID string
Capabilities *client.Capabilities
UseNewProtocol bool
IsLegacyClient bool
Adapter protocol.ProtocolAdapter
// contains filtered or unexported fields
}
WebSocketConnection represents a WebSocket connection with metadata