Documentation ¶
Index ¶
- Constants
- type Client
- type ClientManager
- type FrameMetadata
- type PacketReader
- type Server
- type ServerWorker
- type Session
- type SessionManager
- func (m *SessionManager) Add(s *Session)
- func (m *SessionManager) Allocate() *Session
- func (m *SessionManager) Close() error
- func (m *SessionManager) CloseIfNoSession() bool
- func (m *SessionManager) Count() int
- func (m *SessionManager) Get(id uint16) (*Session, bool)
- func (m *SessionManager) Remove(id uint16)
- func (m *SessionManager) Size() int
- type SessionStatus
- type StreamReader
- type TargetNetwork
- type Writer
Constants ¶
View Source
const ( OptionData bitmask.Byte = 0x01 OptionError bitmask.Byte = 0x02 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type ClientManager ¶
type ClientManager struct {
// contains filtered or unexported fields
}
func NewClientManager ¶
func NewClientManager(p proxy.Outbound, d proxy.Dialer, c *proxyman.MultiplexingConfig) *ClientManager
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 *buf.Buffer) (*FrameMetadata, error)
func ReadMetadata ¶
func ReadMetadata(reader io.Reader) (*FrameMetadata, error)
ReadMetadata reads FrameMetadata from the given reader.
type PacketReader ¶
type PacketReader struct {
// contains filtered or unexported fields
}
PacketReader is an io.Reader that reads whole chunk of Mux frames every time.
func NewPacketReader ¶
func NewPacketReader(reader io.Reader) *PacketReader
NewPacketReader creates a new PacketReader.
func (*PacketReader) ReadMultiBuffer ¶
func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error)
ReadMultiBuffer implements buf.Reader.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
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 }
Session represents a client connection in a Mux connection.
type SessionManager ¶
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() error
func (*SessionManager) CloseIfNoSession ¶
func (m *SessionManager) CloseIfNoSession() bool
func (*SessionManager) Count ¶
func (m *SessionManager) Count() int
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
}
StreamReader reads Mux frame as a stream.
func NewStreamReader ¶
func NewStreamReader(reader *buf.BufferedReader) *StreamReader
NewStreamReader creates a new StreamReader.
func (*StreamReader) ReadMultiBuffer ¶
func (r *StreamReader) ReadMultiBuffer() (buf.MultiBuffer, error)
ReadMultiBuffer implmenets buf.Reader.
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 NewWriter ¶
func NewWriter(id uint16, dest net.Destination, writer buf.Writer, transferType protocol.TransferType) *Writer
func (*Writer) WriteMultiBuffer ¶
func (w *Writer) WriteMultiBuffer(mb buf.MultiBuffer) error
WriteMultiBuffer implements buf.Writer.
Click to show internal directories.
Click to hide internal directories.