bedprox

package module
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

BedProx [WIP]

Simple Minecraft Bedrock reverse proxy

Features

  • Reverse Proxy
  • HAProxy Protocol Support (NOT TESTED)
  • Webhooks
  • REST API

How to use/deploy

git clone https://github.com/haveachin/bedprox
cd bedprox
docker-compose up -build

Config can be found in the data/bedprox folder

Sources

https://github.com/Sandertv/gophertunnel/tree/f8b092d0378cc7fdbf87640dae4def2d06fddeb4
https://wiki.vg/Raknet_Protocol
https://wiki.vg/Bedrock_Protocol

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPN

type CPN struct {
	ConnProcessor
	Log logr.Logger
}

Processing Node

func (*CPN) Start

func (cpn *CPN) Start(cpnChan <-chan net.Conn, srvChan chan<- ProcessedConn)

type ConnPool

type ConnPool struct {
	Log logr.Logger
}

func (*ConnPool) Start

func (cp *ConnPool) Start(poolChan <-chan ConnTunnel)

type ConnProcessor

type ConnProcessor interface {
	ProcessConn(c net.Conn) (ProcessedConn, error)
}

type ConnTunnel

type ConnTunnel struct {
	Conn       net.Conn
	RemoteConn net.Conn
}

func (ConnTunnel) Close

func (t ConnTunnel) Close()

func (ConnTunnel) Start

func (t ConnTunnel) Start()

type Gateway

type Gateway interface {
	// GetID resturns the ID of the gateway
	GetID() string
	// GetServerIDs returns the IDs of the servers
	// that are registered in that gateway
	GetServerIDs() []string
	SetLogger(log logr.Logger)
	ListenAndServe(cpnChan chan<- net.Conn) error
}

type ProcessedConn

type ProcessedConn interface {
	net.Conn
	// GatewayID is the ID of the gateway that they connected through
	GatewayID() string
	// Username returns the username of the connecting player
	Username() string
	// ServerAddr returns the exact Server Address string
	// that the client send to the server
	ServerAddr() string
	// Disconnect sends the client a disconnect message
	// and closes the connection
	Disconnect(msg string) error
	ServerNotFoundMessage() string
}

type Server

type Server interface {
	GetID() string
	GetDomains() []string
	GetWebhookIDs() []string
	ProcessConn(c net.Conn, webhooks []webhook.Webhook) (ConnTunnel, error)
	SetLogger(log logr.Logger)
}

type ServerGateway

type ServerGateway struct {
	GatewayIDServerIDs map[string][]string
	Servers            []Server
	Webhooks           []webhook.Webhook
	Log                logr.Logger
	// contains filtered or unexported fields
}

func (ServerGateway) Start

func (sg ServerGateway) Start(srvChan <-chan ProcessedConn, poolChan chan<- ConnTunnel) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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