autotls

command
v0.0.0-...-8a6fd5b Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 13 Imported by: 0

README

libp2p host with Secure WebSockets and AutoTLS

This example builds on the libp2p host example example and demonstrates how to use AutoTLS to automatically generate a wildcard Let's Encrypt TLS certificate unique to the libp2p host (*.<PeerID>.libp2p.direct), and use it with libp2p WebSockets transport over TCP enabling browsers to directly connect to the libp2p host.

For this example to work, you need to have a public IP address and be publicly reachable. AutoTLS is guarded by connectivity check, and will not ask for a certificate unless your libp2p node emits event.EvtLocalReachabilityChanged with network.ReachabilityPublic.

Running the example

From the go-libp2p/examples directory run the following:

cd autotls/
go run .

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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