Help us shape the future of Go! Take the 2026 Go Developer Survey

wschan

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkSize = 0xffff //65535, typical TCP MTU
)

Variables

This section is empty.

Functions

func Client

func Client(ctx context.Context, target string, send, receive chan []byte)

Client connects to a websocket server and bidirectionally relays binary messages

func Host

func Host(ctx context.Context, listen int, send, receive chan []byte)

Host listens for a ws connection, then relays messages bidirectionally over the channels until the context ends. Only one connection is accepted at a time.

func PipeBinaryIgnoreText

func PipeBinaryIgnoreText(ctx context.Context, wconn *websocket.Conn, send, receive chan []byte)

PipeBinaryIgnoreText relays binary data between net.Conn and websocket.Conn pass websocket.Conn with pointer due to mutex Use of NextReader/Writer modified from https://github.com/hazaelsan/ssh-relay/blob/master/session/corprelay/corprelay.go

Types

This section is empty.

Jump to

Keyboard shortcuts

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