Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drulac/socket.io-with-pgp
transparent socket.io surcouche who encrypt and sign your messages transparently
https://github.com/drulac/socket.io-with-pgp
Last synced: about 14 hours ago
JSON representation
transparent socket.io surcouche who encrypt and sign your messages transparently
- Host: GitHub
- URL: https://github.com/drulac/socket.io-with-pgp
- Owner: Drulac
- License: mit
- Created: 2017-07-24T18:33:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T18:48:19.000Z (over 7 years ago)
- Last Synced: 2024-04-24T13:36:26.757Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# socket.io-with-PGP
transparent socket.io surcouche who encrypt and sign your messages transparently```js
var io = require('socket.io')(6336);
var SocketWithPGP = require('socket.io-with-pgp');
var SocketWithGet = require('socket.io-with-get');try{
(async ()=>{io.on('connection', async function(socket){
let client = new SocketWithPGP(socket, async (client)=>{
client = new SocketWithGet(client);client.on('ping', (data, cb)=>{
cb(data);
});client.get("name", {}, (err, data)=>{
console.log(data);
});
});await client.generateKeys(512, { name:'Jon Smith', email:'[email protected]' }, "secret passphrase");
});var soc = require('socket.io-client')('http://localhost:6336');
let socket = new SocketWithPGP(soc, async (soc)=>{socket = new SocketWithGet(socket);
socket.get("ping", {start: new Date().getTime()}, (err, data)=>{
let pingTime = new Date().getTime() - data.start;
console.log(pingTime+" ms");
});socket.on('name', (data, cb)=>{
cb("My name is Jhon... Jhon Doe...");
});
});
await socket.generateKeys(512, { name:'Jon Smith', email:'[email protected]' }, "secret passphrase");})();
}catch(e){
throw e;
}
```