http

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "http"
)

Variables

This section is empty.

Functions

func GetClientIPFromRequest

func GetClientIPFromRequest(r *http.Request) net.IP

Types

type DNSQuestion added in v0.1.1

type DNSQuestion struct {
	Name string `json:"name"`
	Type uint16 `json:"type"`
}

type DNSRR added in v0.1.1

type DNSRR struct {
	DNSQuestion
	TTL  uint32 `json:"TTL"`
	Data string `json:"data"`
}

type DNSResponse added in v0.1.1

type DNSResponse struct {
	Status             uint32        `json:"Status"`
	Truncated          bool          `json:"TC"`
	RecursionDesired   bool          `json:"RD"`
	RecursionAvailable bool          `json:"RA"`
	AuthenticatedData  bool          `json:"AD"`
	CheckingDisabled   bool          `json:"CD"`
	Question           []DNSQuestion `json:"Question"`
	Answer             []DNSRR       `json:"Answer"`
	Authority          []DNSRR       `json:"Authority,omitempty"`
	Additional         []DNSRR       `json:"Additional,omitempty"`
	Comment            string        `json:"Comment,omitempty"`
	EdnsClientSubnet   string        `json:"edns_client_subnet,omitempty"`
}

DNSResponse implements Google DoH protocol

func ParseDNSResponseFromMessage added in v0.1.1

func ParseDNSResponseFromMessage(msg *dns.Msg) DNSResponse

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

func New

func New(listenAddress string, certFile, keyFile string, handler types.ContextHandler) (*Endpoint, error)

func (*Endpoint) Close

func (e *Endpoint) Close() error

TODO(@oif): Graceful shutdown

func (*Endpoint) Run

func (e *Endpoint) Run() error

func (*Endpoint) ServeHTTP

func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL