websocket

package
v0.0.0-...-a4f63c7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT, Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Overview

Package websocket implements a websocket based transport for go-libp2p.

Index

Constants

This section is empty.

Variables

WsFmt is multiaddr formatter for WsProtocol

Functions

func ConvertWebsocketMultiaddrToNetAddr

func ConvertWebsocketMultiaddrToNetAddr(maddr ma.Multiaddr) (net.Addr, error)

func ParseWebsocketNetAddr

func ParseWebsocketNetAddr(a net.Addr) (ma.Multiaddr, error)

Types

type Option

type Option func(*WebsocketTransport) error

func WithTLSClientConfig

func WithTLSClientConfig(c *tls.Config) Option

WithTLSClientConfig sets a TLS client configuration on the WebSocket Dialer. Only relevant for non-browser usages.

Some useful use cases include setting InsecureSkipVerify to `true`, or setting user-defined trusted CA certificates.

func WithTLSConfig

func WithTLSConfig(conf *tls.Config) Option

WithTLSConfig sets a TLS configuration for the WebSocket listener.

type WebsocketTransport

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

WebsocketTransport is the actual go-libp2p transport

func (*WebsocketTransport) CanDial

func (t *WebsocketTransport) CanDial(a ma.Multiaddr) bool

func (*WebsocketTransport) Dial

func (*WebsocketTransport) Listen

func (*WebsocketTransport) Protocols

func (t *WebsocketTransport) Protocols() []int

func (*WebsocketTransport) Proxy

func (t *WebsocketTransport) Proxy() bool

func (*WebsocketTransport) Resolve

func (t *WebsocketTransport) Resolve(ctx context.Context, maddr ma.Multiaddr) ([]ma.Multiaddr, error)

Jump to

Keyboard shortcuts

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