mux

package
v0.0.0-...-b6031a6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OptionNone  = byte(0x00)
	OptionData  = byte(0x01)
	OptionError = byte(0x02)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is an mux-compatible client for v2ray-plugin, not a complete implementation

func NewConn

func NewConn(conn net.Conn, option MuxOption) *Conn

func (*Conn) Close

func (m *Conn) Close() error

func (*Conn) Read

func (m *Conn) Read(b []byte) (int, error)

func (*Conn) Write

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

type Mux

type Mux struct {
	NextDialer     netproxy.Dialer
	Addr           string
	PassthroughUdp bool
}

Mux is a base Mux struct

func (*Mux) DialContext

func (s *Mux) DialContext(ctx context.Context, network, addr string) (c netproxy.Conn, err error)

type MuxOption

type MuxOption struct {
	ID   [2]byte
	Port uint16
	Host string
	Type string
}

type SessionStatus

type SessionStatus = byte
const (
	SessionStatusNew       SessionStatus = 0x01
	SessionStatusKeep      SessionStatus = 0x02
	SessionStatusEnd       SessionStatus = 0x03
	SessionStatusKeepAlive SessionStatus = 0x04
)

Jump to

Keyboard shortcuts

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