Documentation
¶
Index ¶
- Constants
- type HttpRequest
- func (p *HttpRequest) Domain() string
- func (p *HttpRequest) IsConnectMethod() bool
- func (p *HttpRequest) IsValidMethod() bool
- func (p *HttpRequest) Method() string
- func (p *HttpRequest) Port() string
- func (p *HttpRequest) Raw() []byte
- func (p *HttpRequest) Tidy()
- func (p *HttpRequest) Version() string
- type TLSHeader
- type TLSMessage
- type TLSMessageType
Constants ¶
View Source
const ( TLSMaxPayloadLen uint16 = 16384 // 16 KB TLSHeaderLen = 5 TLSHandshake TLSMessageType = 0x16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func ReadHttpRequest ¶
func ReadHttpRequest(rdr io.Reader) (*HttpRequest, error)
ReadHttpRequest reads an HTTP request from the provided io.Reader.
func (*HttpRequest) Domain ¶
func (p *HttpRequest) Domain() string
func (*HttpRequest) IsConnectMethod ¶
func (p *HttpRequest) IsConnectMethod() bool
IsConnectMethod checks if the HTTP method is CONNECT.
func (*HttpRequest) IsValidMethod ¶
func (p *HttpRequest) IsValidMethod() bool
IsValidMethod checks if the HTTP method is valid.
func (*HttpRequest) Method ¶
func (p *HttpRequest) Method() string
func (*HttpRequest) Port ¶
func (p *HttpRequest) Port() string
func (*HttpRequest) Raw ¶
func (p *HttpRequest) Raw() []byte
func (*HttpRequest) Tidy ¶
func (p *HttpRequest) Tidy()
Tidy removes unnecessary headers and tidies up the HTTP request.
func (*HttpRequest) Version ¶
func (p *HttpRequest) Version() string
type TLSHeader ¶
type TLSHeader struct {
Type TLSMessageType
ProtoVersion uint16 // major | minor
PayloadLen uint16
}
type TLSMessage ¶
type TLSMessage struct {
Header TLSHeader
Raw []byte //Header + Payload
RawHeader []byte
RawPayload []byte
}
func ReadTLSMessage ¶
func ReadTLSMessage(r io.Reader) (*TLSMessage, error)
ReadTLSMessage reads a TLS message from the provided io.Reader.
func (*TLSMessage) IsClientHello ¶
func (m *TLSMessage) IsClientHello() bool
IsClientHello checks if the TLS message is a Client Hello message. According to RFC 8446 Section 4: TLS handshake message type 0x01 means "client_hello".
type TLSMessageType ¶
type TLSMessageType byte
Click to show internal directories.
Click to hide internal directories.