How to use Secure Websocket with the swarm

Im looking to enable secure websockets (wss) on my libp2p app. The example listed in the docs (WsConfig in libp2p::websocket - Rust) give an example of building a transport, but now how to integrate it with the swarm. Ive tried using the WsConfig with the with_websocket() function but I dont think I can use it there. Next I tried to use .with_other_transport() but could not figure out how to map the connections to what the function wants.

How can I add a wss transport to the swarm so I can listen on /ip/tcp/0/wss/%2Ftest (/ip/tcp/0/wss//test)

Hello @DeepBlue ,

Those are great questions. We just published a blog post that has some information about websockets and webtransports in rust-libp2p.

I don’t have the exact answer for you but if you jump on our Slack or Matrix chats and ping @DougAnderson444 he should be able to help you out.

Cheers! :beers: