ws-rc4
v0.1.3
Published
RC4-encrypted websocket library
Downloads
12
Readme
ws-rc4
RC4-encrypted websocket library
Install
npm install --save ws-rc4
Usage
This library encrypts all connections spawned from it with a single key. Encrypting all connections from this library allows you to have private communications between servers (or browsers, if you want that). Those who do not know the encryption key simply see jibberish.
Node.JS
In the background, the ws package is used. This package is designed to simply wrap around it, resulting in the exact same usage.
const WSRC4 = require('ws-rc4');
// Generate a new encrypted 'ws' library
let WS = WSRC4("ENCRYPTION KEY");
// Take a look at https://npmjs.com/package/ws for how to continue
Browser
You could use requirejs, browserify or simply load dist/browser.js directly.
<!-- Directly load the lib -->
<!-- Registers anonymously to RequireJS or onto window.WSRC4 -->
<script src="https://unpkg.com/ws-rc4/dist/browser.js"></script>
// Browserify usages matches node's usage
// Keep in mind that ws.Server is not supported in browser
const WSRC4 = require('ws-rc4');