core

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("closed")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(serverAddr string, protocol string, auth []byte, tlsConfig *tls.Config, quicConfig *quic.Config,
	transport *transport.ClientTransport, sendBPS uint64, recvBPS uint64, congestionFactory CongestionFactory,
	obfuscator obfs.Obfuscator,
) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialTCP added in v0.5.0

func (c *Client) DialTCP(addr string) (net.Conn, error)

func (*Client) DialUDP added in v0.5.0

func (c *Client) DialUDP() (UDPConn, error)

type CongestionFactory

type CongestionFactory func(refBPS uint64) congestion.CongestionControl

type ConnectFunc added in v0.9.5

type ConnectFunc func(addr net.Addr, auth []byte, sSend uint64, sRecv uint64) (bool, string)

type DisconnectFunc added in v0.9.5

type DisconnectFunc func(addr net.Addr, auth []byte, err error)

type Server

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

func NewServer

func NewServer(addr string, protocol string, tlsConfig *tls.Config, quicConfig *quic.Config, transport *transport.ServerTransport,
	sendBPS uint64, recvBPS uint64, congestionFactory CongestionFactory, disableUDP bool, aclEngine *acl.Engine,
	obfuscator obfs.Obfuscator, connectFunc ConnectFunc, disconnectFunc DisconnectFunc,
	tcpRequestFunc TCPRequestFunc, tcpErrorFunc TCPErrorFunc,
	udpRequestFunc UDPRequestFunc, udpErrorFunc UDPErrorFunc, promRegistry *prometheus.Registry,
) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Serve

func (s *Server) Serve() error

type TCPErrorFunc added in v0.5.0

type TCPErrorFunc func(addr net.Addr, auth []byte, reqAddr string, err error)

type TCPRequestFunc added in v0.5.0

type TCPRequestFunc func(addr net.Addr, auth []byte, reqAddr string, action acl.Action, arg string)

type UDPConn added in v0.5.0

type UDPConn interface {
	ReadFrom() ([]byte, string, error)
	WriteTo([]byte, string) error
	Close() error
}

type UDPErrorFunc added in v0.5.0

type UDPErrorFunc func(addr net.Addr, auth []byte, sessionID uint32, err error)

type UDPRequestFunc added in v0.5.0

type UDPRequestFunc func(addr net.Addr, auth []byte, sessionID uint32)

Jump to

Keyboard shortcuts

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