When using js-ipfs it will only connect to wss nodes that were in the initial bootstrap list. However, it’s possible today to make go-ipfs advertise dns4 wss address.
go-ipfs does not support wss natively, you must put in behind a reverse proxy. But you can tell go-ipfs to advertise that address with something like this
{
"Addresses": {
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip4/0.0.0.0/tcp/4002/ws",
"/dns4/ipfs.scalable.io/tcp/443/wss",
"/ip4/0.0.0.0/udp/4001/quic"
],
"Announce": [
"/dnsaddr/ipfs.scalable.io",
"/dns4/ipfs.scalable.io/tcp/4002/ws",
"/dns4/ipfs.scalable.io/tcp/443/wss",
"/dns4/ipfs.scalable.io/tcp/4001",
"/dns4/ipfs.scalable.io/udp/4001/quic"
]
}
}
However the wss seems to get zero natural connections, only when I explicitly bootstrap js-ipfs does it get a connection.
I can verify that it is getting advertised in the dht correctly:
$ ipfs dht findpeer 12D3KooWJxNHY6zE1KnzFdBJrTMCbhCVNtSLvjp7qR5Wsp49DnUC
/dnsaddr/ipfs.scalable.io
/dns4/ipfs.scalable.io/tcp/4002/ws
/dns4/ipfs.scalable.io/tcp/4001
/dns4/ipfs.scalable.io/tcp/443/wss
/dns4/ipfs.scalable.io/udp/4001/quic
I believe there is a plan to make go-ipfs support wss and webrtc directly, but we should be able to at least be able to do wss peer discovery today.
Worse you can see in the js console that it attempts to connect to /dns4/ipfs.scalable.io/tcp/4002/ws but fails because browsers need it to be over tls. It then never attempts to connect to the wss port. This is repeatable by trying to access content that is only on that node.