sock

package
v0.1.52 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRequest

func IsRequest(r *http.Request) bool

IsRequest returns whether this is probably a WebSocket request.

func Transport

func Transport(fn func(t transport.Transport) error, options *websocket.AcceptOptions) http.HandlerFunc

Transport returns a http.HandlerFunc that wraps a websocket setup/teardown into a transport.Transport which sends and receives JSON packets. The transport.Transport provides a context which represents the socket; use its own context only if you're fine with waiting forever while the connection is open. The handler should return a websocket.CloseError to emit a specfic state to the caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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