kcpserver

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AddrMask byte = 0xf
)

Variables

View Source
var ErrCipherNotSupported = errors.New("cipher not supported")

ErrCipherNotSupported occurs when a cipher is not supported (likely because of security concerns).

View Source
var (
	Socks5ConnectedRemote = []byte{0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x43}
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

type Cipher

type Cipher interface {
	StreamConnCipher
	PacketConnCipher
}

func PickCipher

func PickCipher(name string, key []byte, password string) (Cipher, error)

PickCipher returns a Cipher of the given name. Derive key from password if given key is empty.

type KcpServer

type KcpServer struct {
	utils.KcpBase
	// RedirectMode  bool
	TunnelChan     chan Channel
	TcpListenPorts map[string]int
	AcceptConn     int
}

KcpServer used for server

func NewKcpServer

func NewKcpServer(config *utils.Config, kconfig *utils.KcpConfig) (kcpServer *KcpServer)

NewKcpServer init KcpServer

func (*KcpServer) Listen

func (serve *KcpServer) Listen()

Listen for kcp

func (*KcpServer) ListenInTls

func (serve *KcpServer) ListenInTls(config *utils.Config)

func (*KcpServer) ListenMux

func (serve *KcpServer) ListenMux(conn io.ReadWriteCloser)

func (*KcpServer) StopTunnel

func (serve *KcpServer) StopTunnel(host string)

func (*KcpServer) WithChannel

func (serve *KcpServer) WithChannel(host, connectTo string) Channel

type PacketConnCipher

type PacketConnCipher interface {
	PacketConn(net.PacketConn) net.PacketConn
}

type StreamConnCipher

type StreamConnCipher interface {
	StreamConn(net.Conn) net.Conn
	NewStreamConn(c net.Conn) *shadowaead.StreamConn
}

Jump to

Keyboard shortcuts

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