Versions in this module Expand all Collapse all v1 v1.0.0 Oct 10, 2023 Changes in this version + const AutoSelectFlag + const AvailableProtocolFlagMessage + const ConfigurationUpdate + const ControlStreamUpgrade + const DuplicateConnectionError + const HTTPHeaderKey + const HTTPHostKey + const HTTPMethodKey + const InternalTCPProxySrcHeader + const InternalUpgradeHeader + const LogFieldConnIndex + const LogFieldConnectionID + const LogFieldIPAddress + const LogFieldLocation + const LogFieldProtocol + const MaxConcurrentStreams + const MaxGracePeriod + const MetricsNamespace + const QUICMetadataFlowID + const ResolveTTL + const TunnelSubsystem + const WebsocketUpgrade + var CanonicalResponseMetaHeader = http.CanonicalHeaderKey(ResponseMetaHeader) + var CanonicalResponseUserHeaders = http.CanonicalHeaderKey(ResponseUserHeaders) + var ProtocolList = []Protocol + var RequestUserHeaders = "cf-netscale-request-headers" + var ResponseMetaHeader = "cf-netscale-response-meta" + var ResponseUserHeaders = "cf-netscale-response-headers" + func DeserializeHeaders(serializedHeaders string) ([]h2mux.Header, error) + func FindCfRayHeader(req *http.Request) string + func H1ResponseToH2ResponseHeaders(status int, h1 http.Header) (h2 []h2mux.Header) + func H2RequestHeadersToH1Request(h2 []h2mux.Header, h1 *http.Request) error + func IsControlResponseHeader(headerName string) bool + func IsH2muxControlRequestHeader(headerName string) bool + func IsH2muxControlResponseHeader(headerName string) bool + func IsLBProbeRequest(req *http.Request) bool + func IsTCPStream(r *http.Request) bool + func IsWebsocketClientHeader(headerName string) bool + func NewHTTP2RespWriter(r *http.Request, w http.ResponseWriter, connType Type, log *zerolog.Logger) (*http2RespWriter, error) + func NewTunnelServerClient(ctx context.Context, stream io.ReadWriteCloser, log *zerolog.Logger) *tunnelServerClient + func SerializeHeaders(h1Headers http.Header) string + type ClassicTunnelProperties struct + Hostname string + OriginCert []byte + UseReconnectToken bool + type ConfigurationUpdateBody struct + Config gojson.RawMessage + Version int32 + type ConnectedFuse interface + Connected func() + IsConnected func() bool + type ControlStreamHandler interface + IsStopped func() bool + ServeControlStream func(ctx context.Context, rw io.ReadWriteCloser, ...) error + func NewControlStream(observer *Observer, connectedFuse ConnectedFuse, ...) ControlStreamHandler + type Credentials struct + AccountTag string + TunnelID uuid.UUID + TunnelSecret []byte + func (c *Credentials) Auth() pogs.TunnelAuth + type DupConnRegisterTunnelError struct + func (e DupConnRegisterTunnelError) Error() string + type EdgeQuicDialError struct + Cause error + func (e *EdgeQuicDialError) Error() string + func (e *EdgeQuicDialError) Unwrap() error + type Event struct + EventType Status + Index uint8 + Location string + Protocol Protocol + URL string + type EventSink interface + OnTunnelEvent func(event Event) + type EventSinkFunc func(event Event) + func (f EventSinkFunc) OnTunnelEvent(event Event) + type HTTP2Connection struct + func NewHTTP2Connection(conn net.Conn, orchestrator Orchestrator, ...) *HTTP2Connection + func (c *HTTP2Connection) Serve(ctx context.Context) error + func (c *HTTP2Connection) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HTTPResponseReadWriteAcker struct + func NewHTTPResponseReadWriterAcker(w ResponseWriter, flusher http.Flusher, req *http.Request) *HTTPResponseReadWriteAcker + func (h *HTTPResponseReadWriteAcker) AckConnection(tracePropagation string) error + func (h *HTTPResponseReadWriteAcker) Read(p []byte) (int, error) + func (h *HTTPResponseReadWriteAcker) Write(p []byte) (int, error) + type MuxerConfig struct + CompressionSetting h2mux.CompressionSetting + HeartbeatInterval time.Duration + MaxHeartbeats uint64 + MetricsUpdateFreq time.Duration + func (mc *MuxerConfig) H2MuxerConfig(h h2mux.MuxedStreamHandler, log *zerolog.Logger) *h2mux.MuxerConfig + type NamedTunnelProperties struct + Client pogs.ClientInfo + Credentials Credentials + QuickTunnelUrl string + type NamedTunnelRPCClient interface + Close func() + GracefulShutdown func(ctx context.Context, gracePeriod time.Duration) + RegisterConnection func(c context.Context, config *NamedTunnelProperties, ...) (*tunnelpogs.ConnectionDetails, error) + SendLocalConfiguration func(c context.Context, config []byte, observer *Observer) error + type Observer struct + func NewObserver(log, logTransport *zerolog.Logger) *Observer + func (o *Observer) RegisterSink(sink EventSink) + func (o *Observer) SendDisconnect(connIndex uint8) + func (o *Observer) SendReconnect(connIndex uint8) + func (o *Observer) SendURL(url string) + type Orchestrator interface + GetConfigJSON func() ([]byte, error) + GetOriginProxy func() (OriginProxy, error) + UpdateConfig func(version int32, config []byte) *pogs.UpdateConfigurationResponse + type OriginProxy interface + ProxyHTTP func(w ResponseWriter, tr *tracing.TracedHTTPRequest, isWebsocket bool) error + ProxyTCP func(ctx context.Context, rwa ReadWriteAcker, req *TCPRequest) error + type Protocol int64 + const HTTP2 + const QUIC + func (p Protocol) String() string + func (p Protocol) TLSSettings() *TLSSettings + type ProtocolSelector interface + Current func() Protocol + Fallback func() (Protocol, bool) + func NewProtocolSelector(protocolFlag string, accountTag string, tunnelTokenProvided bool, needPQ bool, ...) (ProtocolSelector, error) + type QUICConnection struct + func NewQUICConnection(ctx context.Context, quicConfig *quic.Config, edgeAddr net.Addr, ...) (*QUICConnection, error) + func (q *QUICConnection) Close() + func (q *QUICConnection) RegisterUdpSession(ctx context.Context, sessionID uuid.UUID, dstIP net.IP, dstPort uint16, ...) (*tunnelpogs.RegisterUdpSessionResponse, error) + func (q *QUICConnection) Serve(ctx context.Context) error + func (q *QUICConnection) UnregisterUdpSession(ctx context.Context, sessionID uuid.UUID, message string) error + func (q *QUICConnection) UpdateConfiguration(ctx context.Context, version int32, config []byte) *tunnelpogs.UpdateConfigurationResponse + type RPCClientFunc func(context.Context, io.ReadWriteCloser, *zerolog.Logger) NamedTunnelRPCClient + type ReadWriteAcker interface + AckConnection func(tracePropagation string) error + type ResponseWriter interface + AddTrailer func(trailerName, trailerValue string) + WriteRespHeaders func(status int, header http.Header) error + type ServerRegisterTunnelError struct + Cause error + Permanent bool + func (e ServerRegisterTunnelError) Error() string + type Status int + const Connected + const Disconnected + const Reconnecting + const RegisteringTunnel + const SetURL + const Unregistering + type TCPRequest struct + CFRay string + CfTraceID string + ConnIndex uint8 + Dest string + FlowID string + LBProbe bool + type TLSSettings struct + NextProtos []string + ServerName string + type TunnelConfigJSONGetter interface + GetConfigJSON func() ([]byte, error) + type TunnelToken struct + AccountTag string + TunnelID uuid.UUID + TunnelSecret []byte + func (t TunnelToken) Credentials() Credentials + func (t TunnelToken) Encode() (string, error) + type Type int + const TypeConfiguration + const TypeControlStream + const TypeHTTP + const TypeTCP + const TypeWebsocket + func (t Type) String() string