config

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Bind:                          "0.0.0.0:25565",
	OnlineMode:                    true,
	OnlineModeKickExistingPlayers: false,
	Forwarding: Forwarding{
		Mode:           LegacyForwardingMode,
		VelocitySecret: "",
	},
	Status: Status{
		ShowMaxPlayers: 1000,
		Motd:           "§bA Gate Proxy\n§bVisit ➞ §fgithub.com/minekube/gate",

		Favicon:         "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AgJCgs6JBZy0AAAB+lJREFUeNrtmGuMXVUZht/LOvcz7diWklbJaKGCWKXFUiiBQjAEhRSLSCEqIKAiogRTmiriBeSiUUhjMCZe2qQxNE0EUZSCidAgYMBSLBJCDC1taAg4xaq1cz/788feZzqgocCoP2Q/f87JOXvvfOtd73dZGygpKSkpKSkpKSkpKSkpKSkpKSkpKXnzwNd7w+ULD0NEBtmQBFqQBNuICFRYwzc3bf7/E+Cyo+cgAIiEbESWJdl1WSQ5VGvWRwnk/0XgpnvfmAhrv3h+HhgFFeJCBCLw8Wt//B8XIB3ogs8umJMHAOCQvtnYtfP5eRGxVNaxMmdKgqzdWSfbIuuuocHBLa2ednx16WJcd9fvXn9EAQSQyGgBwUCMMbAvAvHfcIAOaBHnl0REY9fO56+itFHSjbI/JHuxrMWyl8r6mq27m+3WKpJ1kvjG2UtevyUtyDqK0t2UNklaLalu63+fAp9bNBdZFogsq0j6OsVVkix7L8WNkh6VLVuLlXyapKbsMUkrR4aGV9caNbRnTkWKPC0kgdpv7e7n2GgH7ant8WgiYom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TpjcmVhdGUAMjAyMC0wOC0wOVQxMDoxMTo0MyswMDowMN6nNEYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjAtMDgtMDlUMTA6MTE6NDMrMDA6MDCv+oz6AAAAAElFTkSuQmCC",
		LogPingRequests: false,
	},
	Query: Query{
		Enabled:     false,
		Port:        25577,
		ShowPlugins: false,
	},
	AnnounceForge:                        false,
	Servers:                              map[string]string{},
	Try:                                  []string{},
	ForcedHosts:                          map[string][]string{},
	FailoverOnUnexpectedServerDisconnect: true,
	ConnectionTimeout:                    5000,
	ReadTimeout:                          30000,
	Quota: Quota{
		Connections: QuotaSettings{
			Enabled:    true,
			OPS:        5,
			Burst:      10,
			MaxEntries: 1000,
		},
		Logins: QuotaSettings{
			Enabled:    true,
			OPS:        0.4,
			Burst:      3,
			MaxEntries: 1000,
		},
	},
	Compression: Compression{
		Threshold: 256,
		Level:     -1,
	},
	HAProxyProtocol:                     false,
	ShouldPreventClientProxyConnections: false,
	BungeePluginChannelEnabled:          true,
	BuiltinCommands:                     true,
	RequireBuiltinCommandPermissions:    false,
	AnnounceProxyCommands:               true,
	Debug:                               false,
	ShutdownReason:                      "§cGate proxy is shutting down...\nPlease reconnect in a moment!",
}

DefaultConfig is a default Config.

Functions

This section is empty.

Types

type Compression

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
	HAProxyProtocol                     bool // Enable HA-Proxy protocol mode
	ShouldPreventClientProxyConnections bool // Sends player IP to Mojang on login

	BungeePluginChannelEnabled       bool
	BuiltinCommands                  bool
	RequireBuiltinCommandPermissions bool // Whether builtin commands require player permissions
	AnnounceProxyCommands            bool

	Debug          bool
	ShutdownReason string
}

Config is the configuration of the proxy.

func (*Config) Validate

func (c *Config) Validate() (warns []error, errs []error)

Validate validates Config.

type ForcedHosts

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

type Forwarding

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"
	NativeForwardingMode ForwardingMode = "native"
	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 Query

type Query struct {
	Enabled     bool
	Port        int
	ShowPlugins bool
}

type Quota

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

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

type Status struct {
	ShowMaxPlayers  int
	Motd            string
	Favicon         string
	LogPingRequests bool
}

Jump to

Keyboard shortcuts

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