wasm

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for js/wasm

Overview

Package wasm implements the browser side of livepage over the page's own WebSocket. Text frames keep being handled by livepage's JS client, while binary frames are multiplexed into numbered streams (Mux.Open) for protocols like aRPC.

Index

Constants

View Source
const (
	// GlobalName is the JS object of the livepage client.
	GlobalName = "livepage"
	// EventClose is dispatched by the JS client when the socket closes.
	EventClose = "livepage:close"
)

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether the livepage JS client is loaded.

Types

type Mux

type Mux struct {
	// contains filtered or unexported fields
}

Mux multiplexes binary frames into numbered streams.

func Dial

func Dial(ctx context.Context) (*Mux, error)

Dial returns a multiplexer of the binary WebSocket frames of the page. Closing it doesn't close the page WebSocket.

func (*Mux) Close

func (m *Mux) Close() error

Close detaches from the page transport and closes all the streams.

func (*Mux) Open

func (m *Mux) Open(id uint8) net.Conn

Open returns the stream with the given id, creating it on demand.

Jump to

Keyboard shortcuts

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