mux

package
v2.23.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressType

type AddressType byte
const (
	AddressTypeIPv4   AddressType = 0x01
	AddressTypeDomain AddressType = 0x02
	AddressTypeIPv6   AddressType = 0x03
)

type Client

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

func NewClient

func NewClient(p proxy.Outbound, dialer proxy.Dialer, m *ClientManager) (*Client, error)

func (*Client) Closed

func (m *Client) Closed() bool

func (*Client) Dispatch

func (m *Client) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) bool

type ClientManager

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

func NewClientManager

func (*ClientManager) Dispatch

func (m *ClientManager) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) error

type FrameMetadata

type FrameMetadata struct {
	SessionID     uint16
	SessionStatus SessionStatus
	Target        net.Destination
	Option        Option
}

func ReadFrameFrom

func ReadFrameFrom(b []byte) (*FrameMetadata, error)

func (FrameMetadata) AsSupplier

func (f FrameMetadata) AsSupplier() buf.Supplier

type Option

type Option byte
const (
	OptionData Option = 0x01
)

func (*Option) Add

func (o *Option) Add(x Option)

func (*Option) Clear

func (o *Option) Clear(x Option)

func (Option) Has

func (o Option) Has(x Option) bool

type Reader

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

func NewReader

func NewReader(reader buf.Reader) *Reader

func (*Reader) Read

func (r *Reader) Read() (buf.MultiBuffer, error)

func (*Reader) ReadMetadata

func (r *Reader) ReadMetadata() (*FrameMetadata, error)

type Server

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

func NewServer

func NewServer(ctx context.Context) *Server

func (*Server) Dispatch

func (s *Server) Dispatch(ctx context.Context, dest net.Destination) (ray.InboundRay, error)

type ServerWorker

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

type Session

type Session struct {
	sync.Mutex

	ID uint16
	// contains filtered or unexported fields
}
func (s *Session) CloseDownlink()
func (s *Session) CloseUplink()

type SessionManager

type SessionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSessionManager

func NewSessionManager() *SessionManager

func (*SessionManager) Add

func (m *SessionManager) Add(s *Session)

func (*SessionManager) Allocate

func (m *SessionManager) Allocate() *Session

func (*SessionManager) Close

func (m *SessionManager) Close()

func (*SessionManager) CloseIfNoSession

func (m *SessionManager) CloseIfNoSession() bool

func (*SessionManager) Get

func (m *SessionManager) Get(id uint16) (*Session, bool)

func (*SessionManager) Remove

func (m *SessionManager) Remove(id uint16)

func (*SessionManager) Size

func (m *SessionManager) Size() int

type SessionStatus

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

type TargetNetwork

type TargetNetwork byte
const (
	TargetNetworkTCP TargetNetwork = 0x01
	TargetNetworkUDP TargetNetwork = 0x02
)

type Writer

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

func NewResponseWriter

func NewResponseWriter(id uint16, writer buf.Writer) *Writer

func NewWriter

func NewWriter(id uint16, dest net.Destination, writer buf.Writer) *Writer

func (*Writer) Close

func (w *Writer) Close()

func (*Writer) Write

func (w *Writer) Write(mb buf.MultiBuffer) error

Jump to

Keyboard shortcuts

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