config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidHostPort added in v0.0.4

func ValidHostPort(hostAndPort string) error

func ValidServerName added in v0.0.4

func ValidServerName(str string) bool

func Validate added in v0.2.0

func Validate(c *Config) (err error)

Types

type Compression added in v0.0.4

type Compression struct {
	Threshold int
	Level     int
}

type Config

type Config struct {
	Bind string // The address to listen for connections.

	OnlineMode                    bool
	OnlineModeKickExistingPlayers bool

	Forwarding Forwarding
	Status     Status
	Query      Query
	// Whether the proxy should present itself as a
	// Forge/FML-compatible server. By default, this is disabled.
	AnnounceForge bool

	Servers                              map[string]string // name:address
	Try                                  []string          // Try server names order
	ForcedHosts                          ForcedHosts
	FailoverOnUnexpectedServerDisconnect bool

	ConnectionTimeout int // Write timeout
	ReadTimeout       int

	Quota                               Quota
	Compression                         Compression
	ProxyProtocol                       bool // ha-proxy compatibility
	ShouldPreventClientProxyConnections bool // sends player ip to mojang

	BungeePluginChannelEnabled bool

	Debug            bool
	ConfigAutoUpdate bool
	Health           HealthProbeService
}

Config is the configuration of the proxy.

type ForcedHosts added in v0.0.4

type ForcedHosts map[string][]string // virtualhost:server names

type Forwarding added in v0.0.4

type Forwarding struct {
	Mode           ForwardingMode
	VelocitySecret string // Used with "velocity" mode
}

type ForwardingMode

type ForwardingMode string

ForwardingMode is a player info forwarding mode.

const (
	NoneForwardingMode   ForwardingMode = "none"
	LegacyForwardingMode ForwardingMode = "legacy"
	// A forwarding mode specified by the Velocity java proxy and
	// supported by PaperSpigot for versions starting at 1.13.
	VelocityForwardingMode ForwardingMode = "velocity"
)

type HealthProbeService added in v0.2.0

type HealthProbeService struct {
	Enabled bool
	Bind    string
}

GRPC health probe service to use with Kubernetes pods. (https://github.com/grpc-ecosystem/grpc-health-probe)

type Query added in v0.0.4

type Query struct {
	Enabled     bool
	Port        int
	ShowPlugins bool
}

type Quota added in v0.0.4

type Quota struct {
	Connections QuotaSettings // Limits new connections per second, per IP block.
	Logins      QuotaSettings // Limits logins per second, per IP block.

}

Quota is the config for rate limiting.

type QuotaSettings added in v0.0.4

type QuotaSettings struct {
	Enabled    bool    // If false, there is no such limiting.
	OPS        float32 // Allowed operations/events per second, per IP block
	Burst      int     // The maximum events per second, per block; the size of the token bucket
	MaxEntries int     // Maximum number of IP blocks to keep track of in cache
}

type Status added in v0.0.4

type Status struct {
	MaxPlayers       int
	Motd             string
	FavIconFile      string
	ShowPingRequests bool
}

Jump to

Keyboard shortcuts

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