server

package
v0.0.0-...-fd8181f Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerClosed = errors.New("server: Server closed")
)

Functions

This section is empty.

Types

type Conn

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

type GrpcHandler

type GrpcHandler interface{ ServeGRPC(net.Conn) }

type GrpcHandlerFunc

type GrpcHandlerFunc func(net.Conn)

func (GrpcHandlerFunc) ServeGRPC

func (f GrpcHandlerFunc) ServeGRPC(conn net.Conn)

type GrpcServer

type GrpcServer struct {
	proto.UnimplementedStreamServiceServer

	Addr    string
	Handler GrpcHandler
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(addr string, handler GrpcHandler, opts transport.Options) *GrpcServer

func (*GrpcServer) Build

func (s *GrpcServer) Build() Server

func (*GrpcServer) Close

func (s *GrpcServer) Close() error

func (*GrpcServer) Error

func (s *GrpcServer) Error() chan error

func (*GrpcServer) LocalAddr

func (s *GrpcServer) LocalAddr() string

func (*GrpcServer) Serve

func (s *GrpcServer) Serve(*Conn)

func (*GrpcServer) Start

func (s *GrpcServer) Start()

func (*GrpcServer) Transfer

func (*GrpcServer) Type

func (s *GrpcServer) Type() ServerType

type KcpHandler

type KcpHandler interface{ ServeKCP(net.Conn) }

type KcpHandlerFunc

type KcpHandlerFunc func(net.Conn)

func (KcpHandlerFunc) ServeKCP

func (f KcpHandlerFunc) ServeKCP(conn net.Conn)

type KcpServer

type KcpServer struct {
	net.Listener
	Addr    string
	Handler KcpHandler
	// contains filtered or unexported fields
}

func NewKcpServer

func NewKcpServer(addr string, handler KcpHandler, opts transport.Options) *KcpServer

func (*KcpServer) Build

func (s *KcpServer) Build() Server

func (*KcpServer) Close

func (s *KcpServer) Close() error

func (*KcpServer) Error

func (s *KcpServer) Error() chan error

func (*KcpServer) LocalAddr

func (s *KcpServer) LocalAddr() string

func (*KcpServer) Serve

func (s *KcpServer) Serve(c *Conn)

func (*KcpServer) Start

func (s *KcpServer) Start()

func (*KcpServer) Type

func (s *KcpServer) Type() ServerType

type ObfsHandler

type ObfsHandler interface{ ServeOBFS(net.Conn) }

type ObfsHandlerFunc

type ObfsHandlerFunc func(net.Conn)

func (ObfsHandlerFunc) ServeOBFS

func (f ObfsHandlerFunc) ServeOBFS(conn net.Conn)

type ObfsServer

type ObfsServer struct {
	Addr    string
	Handler ObfsHandler
	// contains filtered or unexported fields
}

func NewObfsServer

func NewObfsServer(addr string, handler ObfsHandler, opts transport.Options) *ObfsServer

func (*ObfsServer) Build

func (s *ObfsServer) Build() Server

func (*ObfsServer) Close

func (s *ObfsServer) Close() error

func (*ObfsServer) Error

func (s *ObfsServer) Error() chan error

func (*ObfsServer) LocalAddr

func (s *ObfsServer) LocalAddr() string

func (*ObfsServer) Serve

func (s *ObfsServer) Serve(*Conn)

func (*ObfsServer) Start

func (s *ObfsServer) Start()

func (*ObfsServer) Type

func (s *ObfsServer) Type() ServerType

type QuicHandler

type QuicHandler interface{ ServeQUIC(net.Conn) }

type QuicHandlerFunc

type QuicHandlerFunc func(net.Conn)

func (QuicHandlerFunc) ServeQUIC

func (f QuicHandlerFunc) ServeQUIC(conn net.Conn)

type QuicServer

type QuicServer struct {
	quic.EarlyListener
	Opts    *transport.QuicOptions
	Addr    string
	Handler QuicHandler
	// contains filtered or unexported fields
}

func NewQuicServer

func NewQuicServer(addr string, handler QuicHandler, opts transport.Options) *QuicServer

func (*QuicServer) Build

func (s *QuicServer) Build() Server

func (*QuicServer) Close

func (s *QuicServer) Close() error

func (*QuicServer) Error

func (s *QuicServer) Error() chan error

func (*QuicServer) LocalAddr

func (s *QuicServer) LocalAddr() string

func (*QuicServer) Serve

func (s *QuicServer) Serve(c *Conn)

func (*QuicServer) Start

func (s *QuicServer) Start()

func (*QuicServer) Type

func (s *QuicServer) Type() ServerType

type Server

type Server interface {
	Build() Server
	Start()
	Error() chan error
	Close() error
	Serve(*Conn)
	LocalAddr() string
	Type() ServerType
}

type ServerType

type ServerType byte
const (
	Tcp ServerType = iota
	Socks
	Http
	SimpleTcpTun
	Kcp
	Ws
	Obfs
	Quic
	Mixed
	Grpc
)

func (ServerType) String

func (t ServerType) String() string

type TcpHandler

type TcpHandler interface{ ServeTCP(net.Conn) }

type TcpHandlerFunc

type TcpHandlerFunc func(net.Conn)

func (TcpHandlerFunc) ServeTCP

func (f TcpHandlerFunc) ServeTCP(conn net.Conn)

type TcpServer

type TcpServer struct {
	Addr    string
	Handler TcpHandler
	// contains filtered or unexported fields
}

func NewTcpServer

func NewTcpServer(addr string, handler TcpHandler, typ ServerType) *TcpServer

func (*TcpServer) Build

func (s *TcpServer) Build() Server

func (*TcpServer) Close

func (s *TcpServer) Close() error

func (*TcpServer) Error

func (s *TcpServer) Error() chan error

func (*TcpServer) LocalAddr

func (s *TcpServer) LocalAddr() string

func (*TcpServer) Serve

func (s *TcpServer) Serve(c *Conn)

func (*TcpServer) Start

func (s *TcpServer) Start()

func (*TcpServer) Type

func (s *TcpServer) Type() ServerType

type WsHandler

type WsHandler interface{ ServeWS(net.Conn) }

type WsHandlerFunc

type WsHandlerFunc func(net.Conn)

func (WsHandlerFunc) ServeWS

func (f WsHandlerFunc) ServeWS(conn net.Conn)

type WsServer

type WsServer struct {
	Addr    string
	Handler WsHandler
	// contains filtered or unexported fields
}

func NewWsServer

func NewWsServer(addr string, handler WsHandler, opts transport.Options) *WsServer

func (*WsServer) Build

func (s *WsServer) Build() Server

func (*WsServer) Close

func (s *WsServer) Close() error

func (*WsServer) Error

func (s *WsServer) Error() chan error

func (*WsServer) LocalAddr

func (s *WsServer) LocalAddr() string

func (*WsServer) Serve

func (s *WsServer) Serve(c *Conn)

func (*WsServer) Start

func (s *WsServer) Start()

func (*WsServer) Type

func (s *WsServer) Type() ServerType

Jump to

Keyboard shortcuts

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