ep2 is a Typescript library that enables secure peer-to-peer communication between browsers, both online and offline. It uses the libsodium library for hybrid encryption and signature verification between online peers using peerjs and the web-push library for encrypted push messaging between offline peers.
To try out ep2, clone the project and start an example server and client using the following commands:
git clone https://github.com/bosskabouter/ep2.git
cd ep2
npm i
npm start
The ep2 library consists of the following packages:
- Client packages:
- Server packages:
- EP2PeerServer - authentication
WebRTC Signaling
server - EP2PushServer - anonymized
Push Endpoint Relay
server
- EP2PeerServer - authentication
- Key encryption packages
For detailed information about each package, see their respective pages.
import { EP2Peer, EP2Key } from "@ep2/peer";
import { EP2Push } from "@ep2/push";
EP2Key.create('*strong* seed').then(async (key) => {
const ep2Push = await EP2Push.register(key);
const ep2Peer = new EP2Peer(key);
});
import {EP2PeerServer, EP2Key} from '@ep2/peerserver'
import {EP2PushServer} from '@ep2/pushserver'
EP2Key.create('*stronger* seed').then( key => {
EP2PushServer(key, { path: "/myPushServer" });
EP2PeerServer(key, { path: "/myPeerServer" })
})
Contributions to this project are welcome! If you would like to contribute, please open an issue or pull request on the GitHub repository.
ep2 is open-source software licensed under the MIT license.