telehash-telesocket

0.0.3 • Public • Published

telesocket

Adding telesocket support to telehash-js

Usage

var self = new require("telehash-js").switch();
require("telehash-telesocket").install(self);

//   - to listen pass path-only uri "/foo/bar", fires callback(socket) on any incoming matching uri
self.socket("/foo/bar", callback);

//   - to connect, pass in full uri "ts://hashname/path" returns socket with .onopen, .onmessage, .onerror, and .send("str")
self.socket("ts://hashname/path");

Readme

Keywords

Package Sidebar

Install

npm i telehash-telesocket

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • quartzjer