Documentation
¶
Index ¶
- Constants
- func VerifyProof(entryNodeID string, exporter []byte, proof Proof, roots *x509.CertPool, ...) (string, error)
- type DialIdentity
- type DialSpec
- type DialState
- type Dialer
- type Entry
- func (e *Entry) Close()
- func (e *Entry) Handler(site http.Handler) http.Handler
- func (e *Entry) RelayCounters() map[string]RelayCounters
- func (e *Entry) SetLogger(log *slog.Logger)
- func (e *Entry) SetServe(cfg ServeConfig) error
- func (e *Entry) States() []PeerState
- func (e *Entry) StopListeners()
- func (e *Entry) SyncListeners(relays []RelayListener) map[string]error
- type PeerState
- type Proof
- type RelayCounters
- type RelayListener
- type ServeConfig
Constants ¶
View Source
const ( CertificateHeader = "X-Mistgate-Bridge-Certificate" SignatureHeader = "X-Mistgate-Bridge-Signature" RelayIDHeader = "X-Mistgate-Relay-ID" ErrorHeader = "X-Mistgate-Bridge-Error" ProtocolHeader = "X-Mistgate-Bridge-Version" StreamHeader = "X-Mistgate-Bridge-Stream" StreamKindHeader = "X-Mistgate-Bridge-Kind" TargetHeader = "X-Mistgate-Bridge-Target" PairIDHeader = "X-Mistgate-Bridge-Pair-ID" StreamKindPanel = "panel" )
View Source
const ( DefaultPoolSize = 2 MinPoolSize = 2 MaxPoolSize = 4 PendingWorkersPerConn = 4 MaxPendingWorkersPerConn = 24 DialRetryMin = time.Second DialRetryMax = time.Minute DialRetryResetAfter = 30 * time.Second BridgePingInterval = 15 * time.Second BridgePingTimeout = 10 * time.Second BridgeConnectionAge = time.Hour BridgeConnectionAgeJitter = BridgeConnectionAge / 5 BridgeDrainTimeout = 10 * time.Minute BridgeConnectionBytes = uint64(1 << 30) BridgeRotateCheck = time.Second BridgeDialTimeout = 15 * time.Second BridgeTargetDialTimeout = 5 * time.Second BridgeKeepAlive = 30 * time.Second )
View Source
const ( MaxStreamsPerExit = 4096 MaxStreamsPerEntry = 8192 MaxPeopleConnsPerExit = 2 * MaxPoolSize // the pool plus the connections that serve out their time MaxPanelConnsPerExit = 2 // the control link's own TLS connection, plus the one a replacing link opens while the old one dies MaxConnectionsPerExit = MaxPeopleConnsPerExit + MaxPanelConnsPerExit AcceptQueueSize = 1024 // a burst of people arrives faster than the listener hands them out PendingStreamsPerExit = 256 MaxPendingClients = 4096 MaxClientsPerEntry = 8192 ClientWaitForStream = time.Second BridgeStreamIdleTimeout = 2 * time.Minute BridgeRequestIdle = 30 * time.Second BridgePairTimeout = 5 * time.Second BridgePanelDialTimeout = BridgeTargetDialTimeout BridgeProgressTimeout = 30 * time.Second // The control link's byte budget: a bucket that holds ControlBudgetBytes and refills at ControlBudgetPerSecond. A busy exit's // session carries a few KiB per second for days, so a total per stream would cut it every hour or two; the bucket only stops an // exit that pumps data at the panel (2 Mbit/s sustained, a 64 MiB burst). ControlBudgetBytes = uint64(64 << 20) ControlBudgetPerSecond = uint64(256 << 10) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DialIdentity ¶
type DialIdentity struct {
NodeID string
CertificateDER []byte
PrivateKey *ecdsa.PrivateKey
}
type DialSpec ¶
type DialSpec struct {
Dial plugin.BridgeDial
Error string // A bridge-wide configuration error; no socket is opened when set.
TargetErrors map[string]string
}
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func NewDialer ¶
func NewDialer(identity func() DialIdentity) *Dialer
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) Handler ¶
Handler adds the private bridge route to a site without changing ordinary site responses.
func (*Entry) RelayCounters ¶
func (e *Entry) RelayCounters() map[string]RelayCounters
func (*Entry) SetServe ¶
func (e *Entry) SetServe(cfg ServeConfig) error
func (*Entry) StopListeners ¶
func (e *Entry) StopListeners()
func (*Entry) SyncListeners ¶
func (e *Entry) SyncListeners(relays []RelayListener) map[string]error
type PeerState ¶
type PeerState struct {
PeerNodeID string
Conns uint32
Since time.Time
Streams uint64
BytesIn uint64
BytesOut uint64
Error string
// Clients is how many people the bridge carries now: pairs a person's connection was handed to and that have not ended.
// Streams only counts up, and the waiting pairs are not people.
Clients uint32
}
type RelayCounters ¶
type RelayListener ¶
Click to show internal directories.
Click to hide internal directories.