Documentation ¶
Overview ¶
Package websocket implements a websocket based transport for go-libp2p.
Index ¶
- Variables
- func ConvertWebsocketMultiaddrToNetAddr(maddr ma.Multiaddr) (net.Addr, error)
- func ParseWebsocketNetAddr(a net.Addr) (ma.Multiaddr, error)
- type Option
- type WebsocketTransport
- func (t *WebsocketTransport) CanDial(a ma.Multiaddr) bool
- func (t *WebsocketTransport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (transport.CapableConn, error)
- func (t *WebsocketTransport) Listen(a ma.Multiaddr) (transport.Listener, error)
- func (t *WebsocketTransport) Protocols() []int
- func (t *WebsocketTransport) Proxy() bool
- func (t *WebsocketTransport) Resolve(ctx context.Context, maddr ma.Multiaddr) ([]ma.Multiaddr, error)
Constants ¶
This section is empty.
Variables ¶
WsFmt is multiaddr formatter for WsProtocol
Functions ¶
Types ¶
type Option ¶
type Option func(*WebsocketTransport) error
func WithTLSClientConfig ¶
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 ¶
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 New ¶
func New(u transport.Upgrader, rcmgr network.ResourceManager, opts ...Option) (*WebsocketTransport, error)
func (*WebsocketTransport) Dial ¶
func (t *WebsocketTransport) Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (transport.CapableConn, error)
func (*WebsocketTransport) Protocols ¶
func (t *WebsocketTransport) Protocols() []int
func (*WebsocketTransport) Proxy ¶
func (t *WebsocketTransport) Proxy() bool
Click to show internal directories.
Click to hide internal directories.