proxy

package
v0.0.0-...-db5ecc8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Behaviour

type Behaviour int
const (
	BehaviourEnabled Behaviour = iota
	BehaviourStall
	BehaviourDisconnected
)

type Proxy

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

func New

func New(t *testing.T, rawURL string, behaviour Behaviour) *Proxy

New creates a new Proxy and starts it.

It listens on a random local port and proxies connections to the given liteserver URL.

The proxy can be configured to behave in different ways (enabled, stall, or disconnected) to simulate different network conditions.

func (*Proxy) Close

func (p *Proxy) Close()

Close closes the proxy and all active connections to it (including listener).

func (*Proxy) DropConnections

func (p *Proxy) DropConnections()

DropConnections closes all active connections to the proxy. Useful for simulating a network failure or server going down.

func (*Proxy) SetBehaviour

func (p *Proxy) SetBehaviour(behaviour Behaviour)

func (*Proxy) URL

func (p *Proxy) URL() string

Jump to

Keyboard shortcuts

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