Documentation
¶
Index ¶
- Constants
- Variables
- func HasFlowConnectRateLimited(metadata []Metadata) bool
- func IsControlResponseHeader(name string) bool
- func IsWebsocketClientHeader(name string) bool
- func SerializeHeaders(header http.Header) string
- func WriteConnectResponse(w io.Writer, responseError error, metadata ...Metadata) error
- func WriteRPCStreamSignature(w io.Writer) error
- type ConnectRequest
- type ConnectResponse
- type ConnectResponseWriter
- type ConnectionType
- type Credentials
- type DatagramSender
- type DatagramV2Type
- type DatagramV3Type
- type Metadata
- type RegistrationClientInfo
- type RegistrationConnectionOptions
- type RegistrationResult
- type RegistrationTunnelAuth
- type RequestID
- type RetryableError
- type StreamType
- type TunnelAuth
- type TunnelToken
Constants ¶
View Source
const ( MetadataHTTPMethod = "HttpMethod" MetadataHTTPHost = "HttpHost" MetadataHTTPHeader = "HttpHeader" MetadataHTTPHeaderPrefix = MetadataHTTPHeader + ":" MetadataHTTPStatus = "HttpStatus" )
View Source
const ( DefaultDatagramVersion = "v2" DatagramVersionV3 = "v3" )
View Source
const ( H2HeaderUpgrade = "Cf-Cloudflared-Proxy-Connection-Upgrade" H2HeaderTCPSrc = "Cf-Cloudflared-Proxy-Src" H2HeaderResponseMeta = "Cf-Cloudflared-Response-Meta" H2HeaderResponseUser = "Cf-Cloudflared-Response-Headers" H2UpgradeControlStream = "control-stream" H2UpgradeWebsocket = "websocket" H2UpgradeConfiguration = "update-configuration" H2ResponseMetaOrigin = `{"src":"origin"}` )
View Source
const MetadataFlowConnectRateLimited = "FlowConnectRateLimited"
View Source
const ProtocolVersion = "01"
Variables ¶
View Source
var ( DataStreamSignature = [6]byte{0x0A, 0x36, 0xCD, 0x12, 0xA1, 0x3E} RPCStreamSignature = [6]byte{0x52, 0xBB, 0x82, 0x5C, 0xDB, 0x65} )
View Source
var HeaderEncoding = base64.RawStdEncoding
Functions ¶
func IsControlResponseHeader ¶
func IsWebsocketClientHeader ¶
func SerializeHeaders ¶
func WriteConnectResponse ¶
func WriteRPCStreamSignature ¶
Types ¶
type ConnectRequest ¶
type ConnectRequest struct {
Dest string `capnp:"dest"`
Type ConnectionType `capnp:"type"`
Metadata []Metadata `capnp:"metadata"`
}
func ReadConnectRequest ¶
func ReadConnectRequest(r io.Reader) (*ConnectRequest, error)
func (*ConnectRequest) MetadataMap ¶
func (r *ConnectRequest) MetadataMap() map[string]string
type ConnectResponse ¶
type ConnectResponseWriter ¶
type ConnectionType ¶
type ConnectionType uint16
const ( ConnectionTypeHTTP ConnectionType = iota ConnectionTypeWebsocket ConnectionTypeTCP )
func (ConnectionType) String ¶
func (c ConnectionType) String() string
type Credentials ¶
type Credentials struct {
AccountTag string `json:"AccountTag"`
TunnelSecret []byte `json:"TunnelSecret"`
TunnelID uuid.UUID `json:"TunnelID"`
Endpoint string `json:"Endpoint,omitempty"`
}
func (*Credentials) Auth ¶
func (c *Credentials) Auth() TunnelAuth
type DatagramSender ¶
type DatagramV2Type ¶
type DatagramV2Type byte
const ( DatagramV2TypeUDP DatagramV2Type = 0 DatagramV2TypeIP DatagramV2Type = 1 DatagramV2TypeIPWithTrace DatagramV2Type = 2 DatagramV2TypeTracingSpan DatagramV2Type = 3 TypeIDLength = 1 )
type DatagramV3Type ¶
type DatagramV3Type byte
const ( DatagramV3TypeRegistration DatagramV3Type = 0 DatagramV3TypePayload DatagramV3Type = 1 DatagramV3TypeICMP DatagramV3Type = 2 DatagramV3TypeRegistrationResponse DatagramV3Type = 3 MaxV3UDPPayloadLen = 1280 )
type Metadata ¶
func FlowConnectRateLimitedMetadata ¶
func FlowConnectRateLimitedMetadata() []Metadata
type RegistrationClientInfo ¶
type RegistrationResult ¶
type RegistrationTunnelAuth ¶
type RetryableError ¶
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string
func (*RetryableError) Unwrap ¶
func (e *RetryableError) Unwrap() error
type StreamType ¶
type StreamType int
const ( StreamTypeData StreamType = iota StreamTypeRPC )
func ReadStreamSignature ¶
func ReadStreamSignature(r io.Reader) (StreamType, error)
type TunnelAuth ¶
type TunnelToken ¶
type TunnelToken struct {
AccountTag string `json:"a"`
TunnelSecret []byte `json:"s"`
TunnelID uuid.UUID `json:"t"`
Endpoint string `json:"e,omitempty"`
}
func (TunnelToken) ToCredentials ¶
func (t TunnelToken) ToCredentials() Credentials
Click to show internal directories.
Click to hide internal directories.