mux

package
v2.43.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionData bitmask.Byte = 0x01
)

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(p proxy.Outbound, dialer proxy.Dialer, m *ClientManager) (*Client, error)

NewClient creates a new mux.Client.

func (*Client) Closed

func (m *Client) Closed() bool

Closed returns true if this Client is closed.

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 (*ClientManager) Dispatch

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

type FrameMetadata

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

func ReadFrameFrom

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

func (FrameMetadata) AsSupplier

func (f FrameMetadata) AsSupplier() buf.Supplier

type MetadataReader

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

func NewMetadataReader

func NewMetadataReader(reader io.Reader) *MetadataReader

func (*MetadataReader) Read

func (r *MetadataReader) Read() (*FrameMetadata, error)

type PacketReader

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

func NewPacketReader

func NewPacketReader(reader io.Reader) *PacketReader

func (*PacketReader) Read

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

type Server

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

func NewServer

func NewServer(ctx context.Context) *Server

NewServer creates a new mux.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 {
	ID uint16
	// contains filtered or unexported fields
}

func (*Session) Close

func (s *Session) Close()

Close closes all resources associated with this session.

func (*Session) NewReader

func (s *Session) NewReader(reader io.Reader) buf.Reader

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) Count

func (m *SessionManager) Count() int

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 StreamReader

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

func NewStreamReader

func NewStreamReader(reader io.Reader) *StreamReader

func (*StreamReader) Read

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

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, transferType protocol.TransferType) *Writer

func NewWriter

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

func (*Writer) Close

func (w *Writer) Close()

func (*Writer) Write

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

Write implements buf.MultiBufferWriter.

Jump to

Keyboard shortcuts

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