Documentation
¶
Overview ¶
Package netfault is a TCP proxy that a load or chaos run puts between a client and a server so it can cut, blackhole or shape the connection without touching either end.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy forwards TCP connections from a loopback listener to a target and can cut, blackhole or shape them.
func (*Proxy) Blackhole ¶
func (p *Proxy) Blackhole()
Blackhole keeps connections open but forwards nothing in either direction, and accepts new connections without dialing the target, until Heal.
func (*Proxy) Close ¶
Close stops the listener, closes every connection and waits for the proxy's goroutines to finish.
func (*Proxy) Cut ¶
func (p *Proxy) Cut()
Cut closes every connection the proxy carries and refuses new ones until Heal. Data a blackhole was holding is dropped: each link is canceled before the mode changes, so nothing parked on the blackhole wakes to forward it.