Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Regions = []Region{ { ID: 0, LocationName: "US East Pittsburgh", Nodes: []Node{ { ID: 1, RegionID: 0, HostnameHTTPS: "pit-1.try.coder.app", }, }, }, }
Functions ¶
func New ¶
func New(ctx context.Context, logger slog.Logger, customTunnelHost string) (*tunnelsdk.Tunnel, 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.
This uses https://github.com/coder/wgtunnel as the server and client implementation.
Types ¶
type Config ¶
type Config struct { Version tunnelsdk.TunnelVersion `json:"version"` PrivateKey device.NoisePrivateKey `json:"private_key"` PublicKey device.NoisePublicKey `json:"public_key"` Tunnel Node `json:"tunnel"` // Used in testing. Normally this is nil, indicating to use DefaultClient. HTTPClient *http.Client `json:"-"` }
func GenerateConfig ¶
Click to show internal directories.
Click to hide internal directories.