working
This commit is contained in:
parent
606858bf10
commit
d4cd0bb5a6
11
wsclient.js
11
wsclient.js
|
@ -73,10 +73,16 @@ function run(copts) {
|
||||||
, remotePort: opts.port
|
, remotePort: opts.port
|
||||||
}, function () {
|
}, function () {
|
||||||
//console.log("[=>] first packet from tunneler to '" + cid + "' as '" + opts.service + "'", opts.data.byteLength);
|
//console.log("[=>] first packet from tunneler to '" + cid + "' as '" + opts.service + "'", opts.data.byteLength);
|
||||||
//localclients[cid].write(opts.data);
|
localclients[cid].write(opts.data);
|
||||||
//localclients[cid].resume();
|
//localclients[cid].resume();
|
||||||
});
|
});
|
||||||
// 'data'
|
// 'data'
|
||||||
|
localclients[cid].on('data', function (chunk) {
|
||||||
|
//console.log("[<=] local '" + opts.service + "' sent to '" + cid + "' <= ", chunk.byteLength, "bytes");
|
||||||
|
//console.log(JSON.stringify(chunk.toString()));
|
||||||
|
wstunneler.send(Packer.pack(opts, chunk), { binary: true });
|
||||||
|
});
|
||||||
|
/*
|
||||||
localclients[cid].on('readable', function (size) {
|
localclients[cid].on('readable', function (size) {
|
||||||
var chunk;
|
var chunk;
|
||||||
|
|
||||||
|
@ -97,6 +103,7 @@ function run(copts) {
|
||||||
wstunneler.send(Packer.pack(opts, chunk), { binary: true });
|
wstunneler.send(Packer.pack(opts, chunk), { binary: true });
|
||||||
} while (chunk);
|
} while (chunk);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
localclients[cid].on('error', function (err) {
|
localclients[cid].on('error', function (err) {
|
||||||
handlers._onLocalError(cid, opts, err);
|
handlers._onLocalError(cid, opts, err);
|
||||||
});
|
});
|
||||||
|
@ -105,7 +112,7 @@ function run(copts) {
|
||||||
handlers._onLocalClose(cid, opts);
|
handlers._onLocalClose(cid, opts);
|
||||||
});
|
});
|
||||||
//localclients[cid].pause();
|
//localclients[cid].pause();
|
||||||
localclients[cid].write(opts.data);
|
//localclients[cid].write(opts.data);
|
||||||
}
|
}
|
||||||
, onend: function (opts) {
|
, onend: function (opts) {
|
||||||
var cid = Packer.addrToId(opts);
|
var cid = Packer.addrToId(opts);
|
||||||
|
|
Loading…
Reference in New Issue