From af90be44c42c7bcf6dc923776a50b8c121342c8e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 6 Oct 2016 16:03:56 -0600 Subject: [PATCH] v1.1.0 --- README.md | 36 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2639e4c..fbbb42b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ # tunnel-packer + A strategy for packing and unpacking tunneled network messages (or any stream) in node.js + +Examples + +``` +var Packer = require('tunnel-packer'); + +Packer.create({ + onmessage: function (msg) { + // msg = { family, address, port, service, data }; + } +, onend: function (msg) { + // msg = { family, address, port }; + } +, onerror: function (err) { + // err = { message, family, address, port }; + } +}); + +var chunk = Packer.pack(address, data, service); +var addr = Packer.socketToAddr(socket); +var id = Packer.addrToId(address); +var id = Packer.socketToId(socket); + +var myDuplex = Packer.Stream.create(socketOrStream); + +var myTransform = Packer.Transform.create({ + address: { + family: '...' + , address: '...' + , port: '...' + } + // hint at the service to be used +, service: 'https' +}); +``` diff --git a/package.json b/package.json index 3108bda..052ff2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tunnel-packer", - "version": "1.0.0", + "version": "1.1.0", "description": "A strategy for packing and unpacking tunneled network messages (or any stream)", "main": "index.js", "scripts": {