normalize

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WS    = B("ws://")
	WSS   = B("wss://")
	HTTP  = B("http://")
	HTTPS = B("https://")
)

Functions

This section is empty.

Types

type B

type B = []byte

func Reason

func Reason(prefix reasons.Reason, format S, params ...any) B

Reason constructs a properly formatted message with a machine readable prefix for OK and CLOSED envelopes.

func URL

func URL(u B) (b B)

URL normalizes the URL

- Adds wss:// to addresses without a port, or with 443 that have no protocol prefix

- Adds ws:// to addresses with any other port

- Converts http/s to ws/s

type E

type E = error

type S

type S = string

Jump to

Keyboard shortcuts

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