arj03 / ssb-browser-demo

A secure scuttlebutt client interface running in the browser
Other
58 stars 11 forks source link

Autocorrect invite codes #201

Open KyleMaas opened 3 years ago

KyleMaas commented 3 years ago

If you go here:

https://room.ld.plazi.org/

You can see an invite code which supports both net and ws:

net:room.ld.plazi.org:8008~shs:XvEHdF+ml9eussisQia9igeFejPtCKG839Gx1CrG4Dw=;ws://0.0.0.0:9999~shs:XvEHdF+ml9eussisQia9igeFejPtCKG839Gx1CrG4Dw=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=

Stripping out the ws section and correcting the hostname, you get:

ws://room.ld.plazi.org:9999~shs:XvEHdF+ml9eussisQia9igeFejPtCKG839Gx1CrG4Dw=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=

(As reported by farewellutopia in %QNJE6OcJ7X171if0mgeT04p4qimGj8z3qbqRAnHWhtU=.sha256)

If you try to join this as a room connection, it does not work. But what does work is to strip out the last part and just use:

ws://room.ld.plazi.org:9999~shs:XvEHdF+ml9eussisQia9igeFejPtCKG839Gx1CrG4Dw=

For ease of use, we should probably figure out how to intelligently pull this out and only use the parts we want.