Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Latest commit

 

History

History
33 lines (25 loc) · 749 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 749 Bytes

vNet Packet Streams

vNet is a simple networking prototype over UDP used by Souliss.

This is the node implementation to enable a Souliss gateway to be written in node.

Reader Usage

var reader = require('../vnet').createReader(),
    udp = require('dgram'), 
    stream = require('stream'),
    output = new stream.Writable();

reader.on('error', function(err) {
  console.log(err);
});

output._write = function(chunk, encoding, callback) {
	console.log(chunk);
	callback();
};

var socket = udp.createSocket('udp4', function (msg) {
  reader.write(msg);
});
socket.bind(230);

reader.pipe(output);