A strategy for packing and unpacking a proxy stream (i.e. packets through a tunnel). Handles multiplexed and tls connections. Used by telebit and telebit-relay.
https://telebit.cloud
0d4a2aef01 | ||
---|---|---|
.gitignore | ||
LICENSE | ||
README.md | ||
index.js | ||
package.json | ||
sni.hello.bin | ||
test.js |
README.md
Daplie is Taking Back the Internet!
Stop serving the empire and join the rebel alliance!
- Invest in Daplie on Wefunder
- Pre-order Cloud, The World's First Home Server for Everyone
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'
});