Skip to content

Instantly share code, notes, and snippets.

@alexeybondarenko
Last active August 8, 2017 20:27
Show Gist options
  • Save alexeybondarenko/61556ac165063e2c7bbce832410cedd7 to your computer and use it in GitHub Desktop.
Save alexeybondarenko/61556ac165063e2c7bbce832410cedd7 to your computer and use it in GitHub Desktop.
const binaryServer = require('binaryjs').BinaryServer;
const socket = new binaryServer({
port: 3001,
});
socket.on('connection', (client) => {
client.on('stream', (stream, meta) => {
stream.on('data', (data) => {
console.log(data);
});
stream.on('end', () => {
console.log('end of stream');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment