utils

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 15 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 DecodeEd added in v0.1.26

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

func DecodeXray0rtt

func DecodeXray0rtt(requestHeader http.Header) ([]byte, http.Header)

func EncodeEd added in v0.1.26

func EncodeEd(edBuf []byte) string

func EncodeXray0rtt

func EncodeXray0rtt(tcp net.Conn, ed uint32) (http.Header, []byte, error)

func IsWebSocketUpgrade added in v0.1.34

func IsWebSocketUpgrade(r *http.Request) bool

Types

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, br *bufio.Reader, state ws.State) *WebsocketConn

func ServerWebsocketUpgrade added in v0.1.34

func ServerWebsocketUpgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*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) Write added in v0.1.34

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

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