hs-libp2p-0.2.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

LibP2P.Transport.WebSocket

Description

WebSocket transport over TCP and TLS.

Each WebSocket connection exposes an ordered byte stream to the standard libp2p security and muxer upgrade pipeline. Only binary WebSocket messages are accepted; message boundaries are hidden from stream consumers.

Synopsis

Documentation

data WebSocketConfig Source #

Outer TLS settings for secure WebSockets.

The default client parameters use the system CA store and normal hostname verification. A WSS listener is disabled until server parameters containing a certificate are supplied explicitly.

defaultWebSocketConfig :: IO WebSocketConfig Source #

Secure defaults for WebSocket dialing. WSS listening remains disabled until webSocketServerTLSParams is configured.

webSocketServerParams :: Credential -> ServerParams Source #

Build ordinary Web-PKI server parameters from a configured credential.

newWebSocketTransport :: IO Transport Source #

Create a WebSocket transport with secure client defaults.

newWebSocketTransportWithConfig :: WebSocketConfig -> IO Transport Source #

Create a WebSocket transport using explicit outer TLS settings.

canDialWebSocket :: Multiaddr -> Bool Source #

Recognize IP or DNS TCP addresses ending in ws or wss, with an optional trailing /p2p component.