Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HostNotFoundErr = errors.New(
"Hostname did not resolve to a known host",
)
View Source
var ListenerClosedErr = errors.New("Listener Closed")
View Source
var ListenerConflictErr = errors.New("Listener already registered")
View Source
var ListenerNotFoundErr = errors.New("Listener already registered")
Functions ¶
This section is empty.
Types ¶
type Net ¶
type Net interface {
Listen(network, address string) (net.Listener, error)
Dial(network, address string) (net.Conn, error)
}
An abstract template matching that of net.
type VirtualHostInfo ¶
Collection of hostnames and ip's that a host can be reached at.
type VirtualWan ¶
type VirtualWan struct {
// contains filtered or unexported fields
}
Thread-safe map of virtual hosts, each of which implements Net. All functions on objects handed out by this type, as well as the net.Listener implementations they generate share a single Mutex to allow for concurrent host lookups. IO itself is synchronized by the underlying os.File handed out by os.Pipe for each virtual connection.
func (*VirtualWan) NewVirtualHost ¶
func (self *VirtualWan) NewVirtualHost(addr string) Net
Register a unique machine on the network where addr is an ip or hostname.
func (*VirtualWan) NewVirtualHostWithInfo ¶
func (self *VirtualWan) NewVirtualHostWithInfo(info VirtualHostInfo) Net
Register a unique machine on the network.
Click to show internal directories.
Click to hide internal directories.