An example on "how to use libsignal-protocol-javascript
?"
server.js
index.html
andscripts
- Run server with node:
node server.js
. (It only requiresws
I think) - Open
index.html
in browser. Register with a username and send messages to other usernames.
Note that because tabs share
localStorage
, using multiple tabs from the same browser won't work. Try different browsers or Private/Incognito Windows/Tabs.
libsignal-protocol.js
was sending SignalProtocolAddress.getName()
when calling storage.isTrustedidentity()
, and it was wrong. Because every username (SignalProtocolAddress.getName()
) can have multiple devices
, identityKeys
should be persistent for every address (username
AND deviceId
). So calls to storage.isTrustedIdentity()
are sending remoteAddress.toString()
instead of remoteAddress.getName()
. See this also.
I applied the changes to libsignal-protocol.js
in a different commit, so it's possible to see what's changed.
I mainly used jsxc-plugin-omemo
for the structure and classed (it was in TypeScript and I wasn't comfortable with that, so converted it to js). So the classes are almost doing what they where doing.