network

package
v0.0.0-...-088cd28 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAC      = "1a:55:89:a2:69:41"
	Netmask  = "255.255.255.0"
	IP       = "10.0.0.1"
	Gateway  = "10.0.0.2"
	Resolver = "8.8.8.8:53"
)

This example starts TCP/IP networking on all available network interfaces (either USB, Ethernet or both), for simplicity each NIC is assigned the same IP address and its own gVisor stack.

For more advanced use cases gVisor supports sharing a single stack across different NIC IDs and routing while this example simply clones interface configuration and stack.

Variables

This section is empty.

Functions

func Init

func Init(_ ConsoleHandler, _ bool, _ bool, _ interface{}) (_ any)

func SetupStaticWebAssets

func SetupStaticWebAssets(banner string)

func StartSSHServer

func StartSSHServer(listener net.Listener, handler ConsoleHandler)

func StartWebServer

func StartWebServer(listener net.Listener, addr string, port uint16, https bool)

Types

type ConsoleHandler

type ConsoleHandler interface {
	Exec(term *term.Terminal, cmd []byte)
	Terminal(term *term.Terminal)
	LogFile() *os.File
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳