yuubinsya

package
v0.3.1-rc.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Chacha20poly1305 = chacha20poly1305Aead{}
View Source
var Sha256 = sha256Hash{}

Functions

func NewConn

func NewConn(c net.Conn, rnonce, wnonce []byte, rciph, wciph cipher.AEAD) net.Conn

NewConn wraps a stream-oriented net.Conn with cipher.

func NewHandshaker

func NewHandshaker(encrypted bool, password []byte) handshaker

func NewReader

func NewReader(r io.Reader, nonce []byte, aead cipher.AEAD, maxPayloadSize int) *reader

func NewServer

func NewServer(config Config) *yuubinsya

func NewWriter

func NewWriter(w io.Writer, nonce []byte, aead cipher.AEAD, maxPayloadSize int) *writer

Types

type Aead

type Aead interface {
	New([]byte) (cipher.AEAD, error)
	KeySize() int
	NonceSize() int
	Name() []byte
}

type Client

type Client struct {
	proxy.Proxy
	// contains filtered or unexported fields
}

func (*Client) Conn

func (c *Client) Conn(ctx context.Context, addr proxy.Address) (net.Conn, error)

func (*Client) PacketConn

func (c *Client) PacketConn(ctx context.Context, addr proxy.Address) (net.PacketConn, error)

type Config

type Config struct {
	Dialer              proxy.Proxy
	Host                string
	Password            []byte
	TlsConfig           *tls.Config
	Type                Type
	ForceDisableEncrypt bool
	NatTable            *nat.Table
}

func (Config) String

func (c Config) String() string

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

type Ed25519

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

func (Ed25519) Sign

func (e Ed25519) Sign(rand io.Reader, digest []byte) (signature []byte, err error)

func (Ed25519) SignatureSize

func (Ed25519) SignatureSize() int

func (Ed25519) Verify

func (e Ed25519) Verify(message, sig []byte) bool

type Hash

type Hash interface {
	New() hash.Hash
	Size() int
}

type Net

type Net byte
var (
	TCP Net = 66
	UDP Net = 77
)

func (Net) Unknown

func (n Net) Unknown() bool

type PacketConn

type PacketConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(payload []byte) (n int, _ net.Addr, err error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(payload []byte, addr net.Addr) (int, error)

type Signer

type Signer interface {
	Sign(rand io.Reader, digest []byte) (signature []byte, err error)
	SignatureSize() int
	Verify(message, sig []byte) bool
}

func NewEd25519

func NewEd25519(hash Hash, key []byte) Signer

type Type

type Type int
var (
	RAW_TCP   Type = 1
	TLS       Type = 2
	QUIC      Type = 3
	WEBSOCKET Type = 4
	GRPC      Type = 5
)

Jump to

Keyboard shortcuts

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