Documentation
¶
Index ¶
Constants ¶
const ChannelKeyHeader = "X-Channel-Key"
ChannelKeyHeader carries a secret of the client when auth is disabled. The channel is bound to it, so that only the same client can issue the channel again (e.g. after a restart) or connect to it.
const (
// DefaultWebhookMaxBodySize is the default limit of a webhook request body.
DefaultWebhookMaxBodySize = 10 << 20
)
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
func GetLocalIP() string
Types ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
type InternalChannelsResp ¶
type MemberlistHandler ¶
type MemberlistHandler struct {
// contains filtered or unexported fields
}
MemberlistHandler serves the tunnel for clusters whose nodes can reach each other directly. Traefik routes each channel to the node holding its WebSocket using /traefik-config.
func NewMemberlistHandler ¶
func NewMemberlistHandler(opts Options, c cluster.PeerCluster) *MemberlistHandler
NewMemberlistHandler creates the handler and subscribes it to messages from the cluster. The cluster must be started by the caller after this.
func (*MemberlistHandler) BuildMux ¶
func (h *MemberlistHandler) BuildMux() *http.ServeMux
BuildMux constructs the HTTP route table for the server.
func (*MemberlistHandler) CleanNonActiveSession ¶
func (h *MemberlistHandler) CleanNonActiveSession()
type Options ¶
type Options struct {
MyIP string
Port int
// ServerCtx is canceled when the server shuts down, to notify WebSocket connections.
ServerCtx context.Context
// WebhookMaxBodySize limits the webhook request body in bytes. DefaultWebhookMaxBodySize is used if 0.
WebhookMaxBodySize int64
AuthEnabled bool
JwtSecret []byte
GithubClientID string
GithubClientSecret string
GithubOrg string
}
type PubSubHandler ¶
type PubSubHandler struct {
// contains filtered or unexported fields
}
PubSubHandler serves the tunnel when nodes cannot reach each other directly (e.g. replicas spread across clusters). Any node can accept /new, /ws and /webhook; a webhook is relayed through the broker to the node holding the channel's WebSocket, and the response is relayed back.
func NewPubSubHandler ¶
func NewPubSubHandler(opts Options, relay cluster.Relay) *PubSubHandler
NewPubSubHandler creates the handler and registers its callbacks to the relay. The relay must be started by the caller after this.
func (*PubSubHandler) BuildMux ¶
func (h *PubSubHandler) BuildMux() *http.ServeMux
func (*PubSubHandler) CleanNonActiveSession ¶
func (h *PubSubHandler) CleanNonActiveSession()