Documentation ¶
Index ¶
- Constants
- Variables
- func GetCompressStreamReaderWriter(stream MuxStream, method string) (io.Reader, io.Writer)
- func IsValidCompressor(method string) bool
- func ReadMessage(stream io.Reader, res interface{}) error
- func WriteMessage(stream io.Writer, req interface{}) error
- type AuthRequest
- type AuthResponse
- type ConnectRequest
- type HTTP2MuxSession
- func (q *HTTP2MuxSession) AcceptStream() (MuxStream, error)
- func (q *HTTP2MuxSession) Close() error
- func (q *HTTP2MuxSession) CloseStream(stream MuxStream) error
- func (q *HTTP2MuxSession) NumStreams() int
- func (q *HTTP2MuxSession) OfferStream(stream TimeoutReadWriteCloser) error
- func (q *HTTP2MuxSession) OpenStream() (MuxStream, error)
- func (q *HTTP2MuxSession) Ping() (time.Duration, error)
- type MuxSession
- type MuxStream
- type ProxyMuxSession
- type ProxyMuxStream
- type QUICMuxSession
- func (q *QUICMuxSession) AcceptStream() (MuxStream, error)
- func (q *QUICMuxSession) Close() error
- func (q *QUICMuxSession) CloseStream(stream MuxStream) error
- func (q *QUICMuxSession) NumStreams() int
- func (q *QUICMuxSession) OpenStream() (MuxStream, error)
- func (q *QUICMuxSession) Ping() (time.Duration, error)
- type TimeoutReadWriteCloser
- type WsConn
Constants ¶
View Source
const ( DefaultMuxCipherMethod = "chacha20poly1305" DefaultMuxInitialCipherCounter = uint64(47816489) AuthOK = 1 HTTPMuxSessionIDHeader = "X-Session-ID" HTTPMuxSessionACKIDHeader = "X-Session-ACK-ID" HTTPMuxPullPeriodHeader = "X-PullPeriod" )
View Source
const ( SnappyCompressor = "snappy" NoneCompressor = "none" )
Variables ¶
Functions ¶
func IsValidCompressor ¶
func ReadMessage ¶
func WriteMessage ¶
Types ¶
type AuthRequest ¶
type AuthRequest struct { Rand string User string CipherCounter uint64 CipherMethod string CompressMethod string }
func ReadAuthRequest ¶
func ReadAuthRequest(stream io.Reader) (*AuthRequest, error)
type AuthResponse ¶
type AuthResponse struct {
Code int
}
type ConnectRequest ¶
func ReadConnectRequest ¶
func ReadConnectRequest(stream io.Reader) (*ConnectRequest, error)
type HTTP2MuxSession ¶ added in v0.27.2
type HTTP2MuxSession struct { net.Conn ServerHost string //Client *http.Client //Client *http2.Transport AcceptCh chan MuxStream // contains filtered or unexported fields }
func NewHTTP2ServerMuxSession ¶ added in v0.27.2
func NewHTTP2ServerMuxSession(conn net.Conn) *HTTP2MuxSession
func (*HTTP2MuxSession) AcceptStream ¶ added in v0.27.2
func (q *HTTP2MuxSession) AcceptStream() (MuxStream, error)
func (*HTTP2MuxSession) Close ¶ added in v0.27.2
func (q *HTTP2MuxSession) Close() error
func (*HTTP2MuxSession) CloseStream ¶ added in v0.27.2
func (q *HTTP2MuxSession) CloseStream(stream MuxStream) error
func (*HTTP2MuxSession) NumStreams ¶ added in v0.27.2
func (q *HTTP2MuxSession) NumStreams() int
func (*HTTP2MuxSession) OfferStream ¶ added in v0.27.2
func (q *HTTP2MuxSession) OfferStream(stream TimeoutReadWriteCloser) error
func (*HTTP2MuxSession) OpenStream ¶ added in v0.27.2
func (q *HTTP2MuxSession) OpenStream() (MuxStream, error)
type MuxSession ¶
type MuxSession interface { OpenStream() (MuxStream, error) CloseStream(stream MuxStream) error AcceptStream() (MuxStream, error) Ping() (time.Duration, error) NumStreams() int Close() error }
func NewHTTP2ClientMuxSession ¶ added in v0.27.2
func NewHTTP2ClientMuxSession(conn net.Conn, host string) (MuxSession, error)
type ProxyMuxSession ¶
func (*ProxyMuxSession) AcceptStream ¶
func (s *ProxyMuxSession) AcceptStream() (MuxStream, error)
func (*ProxyMuxSession) CloseStream ¶
func (s *ProxyMuxSession) CloseStream(stream MuxStream) error
func (*ProxyMuxSession) OpenStream ¶
func (s *ProxyMuxSession) OpenStream() (MuxStream, error)
type ProxyMuxStream ¶
type ProxyMuxStream struct { TimeoutReadWriteCloser // contains filtered or unexported fields }
func (*ProxyMuxStream) Auth ¶
func (s *ProxyMuxStream) Auth(req *AuthRequest) error
func (*ProxyMuxStream) Close ¶
func (s *ProxyMuxStream) Close() error
func (*ProxyMuxStream) Connect ¶
func (s *ProxyMuxStream) Connect(network string, addr string) error
func (*ProxyMuxStream) StreamID ¶
func (s *ProxyMuxStream) StreamID() uint32
type QUICMuxSession ¶
func (*QUICMuxSession) AcceptStream ¶
func (q *QUICMuxSession) AcceptStream() (MuxStream, error)
func (*QUICMuxSession) Close ¶
func (q *QUICMuxSession) Close() error
func (*QUICMuxSession) CloseStream ¶
func (q *QUICMuxSession) CloseStream(stream MuxStream) error
func (*QUICMuxSession) NumStreams ¶
func (q *QUICMuxSession) NumStreams() int
func (*QUICMuxSession) OpenStream ¶
func (q *QUICMuxSession) OpenStream() (MuxStream, error)
type TimeoutReadWriteCloser ¶ added in v0.29.0
Click to show internal directories.
Click to hide internal directories.