config

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWatchServiceAddr = "wss://watch-connect.minekube.net"

Variables

View Source
var DefaultConfig = Config{
	Enabled:                false,
	WatchServiceAddr:       DefaultWatchServiceAddr,
	Name:                   "",
	EnforcePassthrough:     false,
	AllowUnencryptedTunnel: false,
	TokenFilePath:          tokenFilename,
	Service: Service{
		Enabled:                 false,
		Addr:                    "localhost:8443",
		PublicTunnelServiceAddr: "ws://localhost:8080/tunnel",
		OverrideRegistration:    false,
	},
}

DefaultConfig is a default Config.

Functions

func New

func New(c Config, inst Instance) (process.Runnable, error)

New validates the config and creates a process collection from it.

Types

type Config

type Config struct {
	Enabled                bool   `yaml:"enabled,omitempty" json:"enabled,omitempty"`                               // Whether to connect Gate to the WatchService
	Name                   string `yaml:"name,omitempty" json:"name,omitempty"`                                     // Endpoint name
	EnforcePassthrough     bool   `yaml:"enforcePassthrough,omitempty" json:"enforcePassthrough,omitempty"`         // Setting to true will reject all sessions in non-passthrough mode.
	WatchServiceAddr       string `yaml:"watchServiceAddr,omitempty" json:"watchServiceAddr,omitempty"`             // The address of the WatchService
	AllowUnencryptedTunnel bool   `yaml:"allowUnencryptedTunnel,omitempty" json:"allowUnencryptedTunnel,omitempty"` // Allow unencrypted tunnels
	TokenFilePath          string `yaml:"tokenFilePath,omitempty" json:"tokenFilePath,omitempty"`                   // Path to the token file

	Service Service
}

Config is the config for Connect.

type ConnHandler

type ConnHandler interface {
	HandleConn(conn net.Conn)
}

type Instance

type Instance interface {
	proxy.ServerRegistry
	ConnHandler
}

type Service

type Service struct {
	Enabled bool   `yaml:"enabled"`
	Addr    string `yaml:"addr"` // The address all services listen on.
	// The address provided to endpoints in session proposals.
	// If not specified falls back to Services.Addr.
	PublicTunnelServiceAddr string `yaml:"publicTunnelServiceAddr"`
	// Overrides servers with the same name.
	OverrideRegistration bool `yaml:"overrideRegistration"`
}

Service is a config for defining self-hosted Connect service for single-instance use.

Jump to

Keyboard shortcuts

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