devtunnel

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointWireguard = "wg-tunnel-udp.coder.app"
	EndpointHTTPS     = "wg-tunnel.coder.app"

	ServerPublicKey = "+KNSMwed/IlqoesvTMSBNsHFaKVLrmmaCkn0bxIhUg0="
	ServerUUID      = "fcad0000-0000-4000-8000-000000000001"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.6.6

type Config struct {
	ID         uuid.UUID              `json:"id"`
	PrivateKey device.NoisePrivateKey `json:"private_key"`
	PublicKey  device.NoisePublicKey  `json:"public_key"`
}

func GenerateConfig added in v0.6.6

func GenerateConfig() (Config, error)

type Tunnel added in v0.6.6

type Tunnel struct {
	URL      string
	Listener net.Listener
}

func New

func New(ctx context.Context, logger slog.Logger) (*Tunnel, <-chan error, error)

New creates a tunnel with a public URL and returns a listener for incoming connections on that URL. Connections are made over the wireguard protocol. Tunnel configuration is cached in the user's config directory. Successive calls to New will always use the same URL. If multiple public URLs in parallel are required, use NewWithConfig.

func NewWithConfig added in v0.6.6

func NewWithConfig(ctx context.Context, logger slog.Logger, cfg Config) (*Tunnel, <-chan error, error)

NewWithConfig calls New with the given config. For documentation, see New.

Jump to

Keyboard shortcuts

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