v2ray-core: github.com/v2ray/v2ray-core/common/protocol/http Index | Files

package http

import "github.com/v2ray/v2ray-core/common/protocol/http"


Package Files

headers.go sniff.go


const (
    HTTP1 version = iota

func ParseHost Uses

func ParseHost(rawHost string, defaultPort net.Port) (net.Destination, error)

ParseHost splits host and port from a raw string. Default port is used when raw string doesn't contain port.

func ParseXForwardedFor Uses

func ParseXForwardedFor(header http.Header) []net.Address

ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it.

func RemoveHopByHopHeaders Uses

func RemoveHopByHopHeaders(header http.Header)

RemoveHopByHopHeaders remove hop by hop headers in http header list.

type SniffHeader Uses

type SniffHeader struct {
    // contains filtered or unexported fields

func SniffHTTP Uses

func SniffHTTP(b []byte) (*SniffHeader, error)

func (*SniffHeader) Domain Uses

func (h *SniffHeader) Domain() string

func (*SniffHeader) Protocol Uses

func (h *SniffHeader) Protocol() string

Package http imports 7 packages (graph). Updated 2019-08-19. Refresh now. Tools for package owners.