websocketcapnp

package module
v0.0.0-...-f179b8b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

README

This repository integrates Go Cap'n Proto with websockets. The main package uses github.com/gobwas/ws, and there is a js package which uses browser APIs via syscall/js, for use from WASM.

Documentation

Overview

Package websocketcapnp integrates websockets with capnproto.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedText = errors.New("Unexpected websocket text frame (expected binary only)")
)

Functions

func NewCodec

func NewCodec(rwc io.ReadWriteCloser, isServer bool) transport.Codec

Return a transport.Codec that sends messages over the websocket connection. Sends each capnproto message in its own websocket binary message.

func NewTransport

func NewTransport(rwc io.ReadWriteCloser, isServer bool) transport.Transport

Like NewCodec, but returns a transport.Transport.

func UpgradeHTTP

func UpgradeHTTP(
	up ws.HTTPUpgrader,
	req *http.Request,
	w http.ResponseWriter,
) (transport.Codec, error)

UpgradeHTTP upgrades an http request to a websocket connection, and returns a transport.Codec that sends capnp messages over it.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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