shadowtls

package module
v0.0.0-...-0e90057 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: GPL-2.0 Imports: 24 Imported by: 2

README

sing-shadowtls

Go implementation of https://github.com/ihciah/shadow-tls

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config ClientConfig) (*Client, error)

func (*Client) DialContext

func (c *Client) DialContext(ctx context.Context) (net.Conn, error)

func (*Client) DialContextConn

func (c *Client) DialContextConn(ctx context.Context, conn net.Conn) (net.Conn, error)

func (*Client) SetHandshakeFunc

func (c *Client) SetHandshakeFunc(handshakeFunc TLSHandshakeFunc)

type ClientConfig

type ClientConfig struct {
	Version      int
	Password     string
	Server       M.Socksaddr
	Dialer       N.Dialer
	StrictMode   bool
	TLSHandshake TLSHandshakeFunc
	Logger       logger.ContextLogger
}

type Handler

type Handler interface {
	N.TCPConnectionHandler
	E.Handler
}

type HandshakeConfig

type HandshakeConfig struct {
	Server M.Socksaddr
	Dialer N.Dialer
}

type Service

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

func NewService

func NewService(config ServiceConfig) (*Service, error)

func (*Service) NewConnection

func (s *Service) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error

type ServiceConfig

type ServiceConfig struct {
	Version                int
	Password               string // for protocol version 2
	Users                  []User // for protocol version 3
	Handshake              HandshakeConfig
	HandshakeForServerName map[string]HandshakeConfig // for protocol version 2/3
	StrictMode             bool                       // for protocol version 3
	WildcardSNI            WildcardSNI                // for protocol version 3
	Handler                Handler
	Logger                 logger.ContextLogger
}

type TLSHandshakeFunc

type TLSHandshakeFunc func(
	ctx context.Context,
	conn net.Conn,
	sessionIDGenerator TLSSessionIDGeneratorFunc,
) error

type TLSSessionIDGeneratorFunc

type TLSSessionIDGeneratorFunc func(clientHello []byte, sessionID []byte) error

type User

type User struct {
	Name     string
	Password string
}

type WildcardSNI

type WildcardSNI int
const (
	WildcardSNIOff WildcardSNI = iota
	WildcardSNIAuthed
	WildcardSNIAll
)

Jump to

Keyboard shortcuts

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