core

package
v0.0.0-...-2202746 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 32 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

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

func LoadCert

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

Types

type Client

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

func (c *Client) ActiveAndServe() error

type DstTransportHandler

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

func NewDstTransportHandler

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

func (*DstTransportHandler) Handle

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

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

func (s *Server) ActiveAndServe() error

type SpoArgs

type SpoArgs map[string]string

type TcpConfig

type TcpConfig struct {
	AndroidVPN bool
}

type Transport

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

type TransportHandler

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