shadowtls

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: GPL-2.0 Imports: 25 Imported by: 17

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
	Handler                Handler
	Logger                 logger.ContextLogger
}

type TLSHandshakeFunc

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

func DefaultTLSHandshakeFunc

func DefaultTLSHandshakeFunc(password string, config *tls.Config) TLSHandshakeFunc

type TLSSessionIDGeneratorFunc

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

type User

type User struct {
	Name     string
	Password string
}

Directories

Path Synopsis
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.

Jump to

Keyboard shortcuts

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