diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-20 16:47:42 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-20 16:47:42 +0200 |
| commit | aa11baa5107f9d077280bc35c7ffccc2442c2045 (patch) | |
| tree | 90b23e6ca5509048159167c4ea5d057883fd9a9f /app/relay/index.js | |
| parent | 109be6a61117844d1156f07fa2c54c62d410a56d (diff) | |
wooooo streaming files over a series of sockets!!
Diffstat (limited to 'app/relay/index.js')
| -rw-r--r-- | app/relay/index.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/app/relay/index.js b/app/relay/index.js index eaec38b..a5a01b9 100644 --- a/app/relay/index.js +++ b/app/relay/index.js @@ -1,7 +1,6 @@ require('dotenv').config() const io = require('socket.io-client') -const ss = require('socket.io-stream') const zerorpc = require('zerorpc') const Readable = require('stream').Readable; @@ -51,20 +50,8 @@ let relay = new zerorpc.Server({ send_frame: function (fn, frame, reply) { reply() - console.log('got frame, ' + frame.length + ' bytes') - remote.emit('frame', fn, frame) - // var stream = ss.createStream() - // stream.on('data', () => { console.log('stream data...') }) - // // console.log(stream) - - // var rs = new Readable() - // rs.on('data', (d) => { console.log('rs data...', d.length) }) - // rs._read = function noop() {} - // rs.pipe(stream) - // rs.push(frame) - // rs.push(null) - // ss(remote).on('frame', () => console.log('frame??')) - // ss(remote).emit('frame', stream, {name: fn}, function(){ console.log('where am i') }) + // console.log('got frame, ' + frame.length + ' bytes') + remote.emit('frame', { fn: fn, frame: frame }) } }) relay.on("error", function(error) { |
