core

package
v0.8.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCertificate

func GenerateCertificate(serverName string, template *x509.Certificate) (dnsName string, cert *x509.Certificate, keyPEM, certPEM []byte, err error)

func GetControlFunc

func GetControlFunc(conf *TcpConfig) func(network, address string, c syscall.RawConn) error

func ListenRawConn added in v0.6.0

func ListenRawConn(l net.Listener, nextHandler TransportHandler) error

func LoadCert added in v0.6.1

func LoadCert(file string) (*x509.Certificate, error)

Types

type Client added in v0.5.0

type Client struct {
	BindAddr        string
	DstAddr         string
	GRPC            bool
	GRPCServiceName string

	ServerName         string
	CA                 string
	CertHash           string
	InsecureSkipVerify bool

	IdleTimeout time.Duration
	SocketOpts  *TcpConfig
	OutboundBuf int
	InboundBuf  int
	// contains filtered or unexported fields
}

func (*Client) ActiveAndServe added in v0.5.0

func (c *Client) ActiveAndServe() error

type DstTransportHandler added in v0.8.0

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

func NewDstTransportHandler added in v0.8.0

func NewDstTransportHandler(dst string, idleTimeout time.Duration, outboundBufSize int) *DstTransportHandler

func (*DstTransportHandler) Handle added in v0.8.0

func (h *DstTransportHandler) Handle(conn net.Conn) error

type SIP003Args

type SIP003Args struct {
	SS_REMOTE_HOST    string
	SS_REMOTE_PORT    string
	SS_LOCAL_HOST     string
	SS_LOCAL_PORT     string
	SS_PLUGIN_OPTIONS SpoArgs
}

SIP003Args contains sip003 args

func GetSIP003Args

func GetSIP003Args() (*SIP003Args, error)

GetSIP003Args get sip003 args from os.Environ(), if no args, returns nil

func (*SIP003Args) GetLocalAddr

func (args *SIP003Args) GetLocalAddr() string

func (*SIP003Args) GetRemoteAddr

func (args *SIP003Args) GetRemoteAddr() string

type Server added in v0.5.0

type Server struct {
	BindAddr              string
	DstAddr               string
	GRPC                  bool
	GRPCServiceName       string
	Cert, Key, ServerName string
	IdleTimeout           time.Duration
	OutboundBuf           int
	InboundBuf            int
	// contains filtered or unexported fields
}

func (*Server) ActiveAndServe added in v0.5.0

func (s *Server) ActiveAndServe() error

type SpoArgs added in v0.4.4

type SpoArgs map[string]string

type TcpConfig

type TcpConfig struct {
	AndroidVPN bool
}

type Transport added in v0.6.0

type Transport interface {
	Dial(ctx context.Context) (net.Conn, error)
}

type TransportHandler added in v0.6.0

type TransportHandler interface {
	Handle(conn net.Conn) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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