util

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HeaderBlacklist = []string{"Cookie", "X-CSRFToken"}

Functions

func CopyMsgs

func CopyMsgs(writeMutex *sync.Mutex, dest *websocket.Conn, src *websocket.Conn) error

func CreateProxyHeaders

func CreateProxyHeaders(w http.ResponseWriter, r *http.Request) (http.Header, string, error)

func DecodeSubprotocol

func DecodeSubprotocol(encodedProtocol string) (string, error)

decodeSubprotocol decodes the impersonation "headers" on a websocket. Subprotocols don't allow '=' or '/'

func FilterHeaders

func FilterHeaders(r *http.Response) error

These headers aren't things that proxies should pass along. Some are forbidden by http2. This fixes the bug where Chrome users saw a ERR_SPDY_PROTOCOL_ERROR for all proxied requests.

func FilterResponseQuery added in v0.0.2

func FilterResponseQuery(bodyBytes []byte, query url.Values) map[string]interface{}

func KeepAlive

func KeepAlive(writeMutex *sync.Mutex, dest *websocket.Conn) error

func SingleJoiningSlash

func SingleJoiningSlash(a, b string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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