Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseHost ¶
ParseHost splits host and port from a raw string. Default port is used when raw string doesn't contain port.
func ParseXForwardedFor ¶
ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it.
func RemoveHopByHopHeaders ¶
RemoveHopByHopHeaders remove hop by hop headers in http header list.
Types ¶
type Http1Header ¶
type Http1Header struct {
// contains filtered or unexported fields
}
func SniffHttp1 ¶
func SniffHttp1(b []byte) (*Http1Header, error)
if whether b is http1 cannot be determined, return nil, protocol.ErrNoClue if b is not http1, return nil, errNotHttp1 if b is http1, returns a Http1Header
func (*Http1Header) FullPath ¶
func (h *Http1Header) FullPath() string
FullPath returns the complete path including query string
func (*Http1Header) Host ¶
func (h *Http1Header) Host() string
func (*Http1Header) Method ¶
func (h *Http1Header) Method() string
Method returns the HTTP method (GET, POST, etc.)
func (*Http1Header) Version ¶
func (h *Http1Header) Version() string
Version returns the HTTP version (e.g., "HTTP/1.1", "HTTP/1.0", "HTTP/2.0")
type SniffHeader ¶
type SniffHeader struct {
// contains filtered or unexported fields
}
func SniffHTTP1Host ¶
func SniffHTTP1Host(b []byte) (*SniffHeader, error)
func (*SniffHeader) Domain ¶
func (h *SniffHeader) Domain() string
func (*SniffHeader) Protocol ¶
func (h *SniffHeader) Protocol() string
Click to show internal directories.
Click to hide internal directories.