fbproxy

package
v0.0.0-...-5994642 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnknownError                    = "UNKNOWN_ERROR"
	ErrContextCanceled                 = "CONTEXT_CANCELED"
	ErrEof                             = "EOF_ERROR"
	ErrResolveIP                       = "RESOLVE_IP_ERROR"
	ErrRetrieveNode                    = "RETRIEVE_NODE_ERROR"
	ErrTcpConnectionReset              = "TCP_CONNECTION_RESET_BY_PEER"
	ErrTcpConnectionRefused            = "TCP_CONNECTION_REFUSED"
	ErrTcpNoRouteToHost                = "TCP_NO_ROUTE_TO_HOST"
	ErrTcpIoTimeout                    = "TCP_IO_TIMEOUT"
	ErrTcpNoConnTargetRegused          = "TCP_NO_CONNECTION_TARGET_REFUSED"
	ErrTcpEstablishedConnectionAborted = "TCP_ESTABLISHED_CONNECTION_ABORTED"
	ErrTcpSocketAccessForbidden        = "TCP_SOCKET_ACCESS_FORBIDDEN"
	ErrTcpSocketUnreachableHost        = "TCP_SOCKET_UNREACHABLE_HOST"
	ErrTlsCertMismatch                 = "TLS_CERTIFICATE_MISMATCH"
	ErrTlsInternal                     = "TLS_INTERNAL_ERROR"
	ErrTlsCertVerify                   = "TLS_VERIFY_CERTIFICATE_ERROR"
	ErrTlsDoesNotLookLikeHandshake     = "TLS_DOES_NOT_LOOK_LIKE_HANDSHAKE"
	ErrTlsHandshakeFailure             = "TLS_HANDSHAKE_FAILURE"
	ErrHttpTimeoutResponseHeaders      = "HTTP_TIMEOUT_RESPONSE_HEADERS"
)

Variables

View Source
var ProcessRequestsem = make(chan struct{}, config.ConcurrentProcessRequests)

Functions

func ProcessRequest

func ProcessRequest(req *http.Request, debug bool) (processRequestResp *http.Response, processRequestErr error)

func ShortenDomain

func ShortenDomain(domain string) string

func StartProxy

func StartProxy()

Types

type DOHServer

type DOHServer struct {
	ID           string
	URL          string
	Reachability int
	Attempts     int
	Successes    int
}

type DOHServers

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

func (*DOHServers) AddDOHServer

func (n *DOHServers) AddDOHServer(dohURL string)

func (*DOHServers) RetrieveDOHServer

func (d *DOHServers) RetrieveDOHServer() DOHServer

func (*DOHServers) UpdateDOHServers

func (d *DOHServers) UpdateDOHServers(dohServer DOHServer, reachability int, debug bool)

type Node

type Node struct {
	ID        string
	Host      string
	IP        string
	Times     []time.Duration
	TotalTime time.Duration
	AvgTime   time.Duration
	Errors    []string
}

type Nodes

type Nodes struct {
	NodesMap map[string]Node
	// contains filtered or unexported fields
}

func (*Nodes) AddNode

func (n *Nodes) AddNode(host, ip string)

func (*Nodes) RecordError

func (n *Nodes) RecordError(node Node, err error)

func (*Nodes) RecordNodeTime

func (n *Nodes) RecordNodeTime(node Node, elapsedTime time.Duration, debug bool)

func (*Nodes) RetrieveNode

func (n *Nodes) RetrieveNode(eTldPlusOne string, orderIndex int, requestID string) Node

type ReadCloserWrapper

type ReadCloserWrapper struct {
	io.Reader
	io.Closer
}

type ZapLogger

type ZapLogger struct{}

func (*ZapLogger) Printf

func (l *ZapLogger) Printf(format string, v ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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