utils

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientHelloServerName added in v0.1.30

func ClientHelloServerName(peeker peek.Peeker) (sni string)

ClientHelloServerName returns the SNI server name inside the TLS ClientHello, without consuming any bytes from br. On any error, the empty string is returned.

func ClientWebsocketDial added in v0.1.35

func ClientWebsocketDial(ctx context.Context, uri url.URL, cHeaders http.Header, dialer proxy.ContextDialer, tlsConfig *tls.Config, v2rayHttpUpgrade bool) (net.Conn, http.Header, error)

func DecodeEd added in v0.1.26

func DecodeEd(s string) ([]byte, error)

func DecodeXray0rtt

func DecodeXray0rtt(requestHeader http.Header) []byte

func EncodeEd added in v0.1.26

func EncodeEd(edBuf []byte) string

func IsV2rayHttpUpdate added in v0.1.35

func IsV2rayHttpUpdate(r *http.Request) bool

func IsWebSocketUpgrade added in v0.1.34

func IsWebSocketUpgrade(r *http.Request) bool

func PrepareXray0rtt added in v0.1.35

func PrepareXray0rtt(tcp net.Conn, ed uint32) ([]byte, error)

Types

type CachedConn added in v0.1.35

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

func NewCachedConn added in v0.1.35

func NewCachedConn(c net.Conn, data []byte) *CachedConn

func (*CachedConn) Read added in v0.1.35

func (c *CachedConn) Read(b []byte) (n int, err error)

func (*CachedConn) ReaderReplaceable added in v0.1.35

func (c *CachedConn) ReaderReplaceable() bool

func (*CachedConn) ToReader added in v0.1.35

func (c *CachedConn) ToReader() io.Reader

func (*CachedConn) ToWriter added in v0.1.35

func (c *CachedConn) ToWriter() io.Writer

func (*CachedConn) WriterReplaceable added in v0.1.35

func (c *CachedConn) WriterReplaceable() bool

type WebsocketConn added in v0.1.34

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

func NewWebsocketConn added in v0.1.34

func NewWebsocketConn(conn net.Conn, state ws.State, isRaw bool) *WebsocketConn

func ServerWebsocketUpgrade added in v0.1.34

func ServerWebsocketUpgrade(w http.ResponseWriter, r *http.Request) (*WebsocketConn, error)

func (*WebsocketConn) Close added in v0.1.34

func (w *WebsocketConn) Close() error

func (*WebsocketConn) Read added in v0.1.34

func (w *WebsocketConn) Read(p []byte) (n int, err error)

func (*WebsocketConn) ReaderReplaceable added in v0.1.35

func (w *WebsocketConn) ReaderReplaceable() bool

func (*WebsocketConn) ToReader added in v0.1.35

func (w *WebsocketConn) ToReader() io.Reader

func (*WebsocketConn) ToWriter added in v0.1.35

func (w *WebsocketConn) ToWriter() io.Writer

func (*WebsocketConn) Write added in v0.1.34

func (w *WebsocketConn) Write(p []byte) (n int, err error)

func (*WebsocketConn) WriterReplaceable added in v0.1.35

func (w *WebsocketConn) WriterReplaceable() bool

Directories

Path Synopsis
Package list implements a doubly linked list.
Package list implements a doubly linked list.

Jump to

Keyboard shortcuts

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