testhelpers

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableLocalAddress

func GetAvailableLocalAddress() string

GetAvailableLocalAddress finds an available local port and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

func HostPortFromAddr

func HostPortFromAddr(endpoint string) (host string, port int, err error)

HostPortFromAddr extracts host and port from a network address

func WaitForEndpoint

func WaitForEndpoint(endpoint string)

Types

type TCPProxy

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

TCPProxy is used for intercepting WebSocket connections and counting the number of bytes transferred.

func NewProxy

func NewProxy(destHostPort string) *TCPProxy

func (*TCPProxy) ClientToServerBytes

func (p *TCPProxy) ClientToServerBytes() int

func (*TCPProxy) IncomingEndpoint

func (p *TCPProxy) IncomingEndpoint() string

func (*TCPProxy) ServerToClientBytes

func (p *TCPProxy) ServerToClientBytes() int

func (*TCPProxy) Start

func (p *TCPProxy) Start() error

func (*TCPProxy) Stop

func (p *TCPProxy) Stop()

Jump to

Keyboard shortcuts

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