http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpInfo

type HttpInfo struct {
	Server             network.TCPInfo
	Client             network.TCPInfo
	Domain             string
	Ip                 string
	Port               int
	Code               int
	Hops               uint32
	DnsTimeMs          uint32
	ConnectTimeMs      uint32
	TLSHandshakeTimeMs uint32
	TTFBMs             uint32
	ReTransmitPackets  uint32
	Speed              float32 // unit kb/s
	TotalSize          int64
	TotalTimeMs        int64
	Error              string
	PingError          string
	Loss               float32
}

func HttpPing

func HttpPing(req *http.Request, ping bool, srcAddr string) (*HttpInfo, error)

func HttpPingGet

func HttpPingGet(url string, ping bool, srcAddr string) (*HttpInfo, error)

func HttpPingServerInfo added in v0.1.1

func HttpPingServerInfo(req *http.Request, ping bool, srcAddr string, serverSupport bool) (*HttpInfo, error)

func HttpPingSimple

func HttpPingSimple(url string) (*HttpInfo, error)

func (*HttpInfo) String

func (h *HttpInfo) String() string

type TcpWrapper

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

func (*TcpWrapper) Close

func (t *TcpWrapper) Close() error

func (*TcpWrapper) Dial

func (t *TcpWrapper) Dial(_ context.Context, _, _ string) (net.Conn, error)

func (*TcpWrapper) DialTLS

func (t *TcpWrapper) DialTLS(ctx context.Context, _, _ string) (net.Conn, error)

func (*TcpWrapper) LocalAddr

func (t *TcpWrapper) LocalAddr() net.Addr

func (*TcpWrapper) Read

func (t *TcpWrapper) Read(b []byte) (n int, err error)

func (*TcpWrapper) RemoteAddr

func (t *TcpWrapper) RemoteAddr() net.Addr

func (*TcpWrapper) SetDeadline

func (t *TcpWrapper) SetDeadline(tm time.Time) error

func (*TcpWrapper) SetReadDeadline

func (t *TcpWrapper) SetReadDeadline(tm time.Time) error

func (*TcpWrapper) SetWriteDeadline

func (t *TcpWrapper) SetWriteDeadline(tm time.Time) error

func (*TcpWrapper) TTFB

func (t *TcpWrapper) TTFB() time.Duration

func (*TcpWrapper) Write

func (t *TcpWrapper) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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