New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sipware

Package Overview
Dependencies
Maintainers
1
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sipware - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

18

lib/client.js

@@ -9,16 +9,20 @@ var net = require('net');

constructor(consumer, options) {
var buf = Buffer.concat([]);
var id = utils.randomAscii(12);
super();
this.consumer = consumer;
this.opts = opts;
if(options.tls) {
var srv = tls;
this.srv = tls;
} else {
var srv = net;
this.srv = net;
}
})
this.client = srv.connect(options, () => {
connect() {
var buf = Buffer.concat([]);
this.client = this.srv.connect(this.opts, () => {
console.log('consumer:'+util.inspect(consumer));
this.trunk.socket = this.client;
consumer.connect();
this.consumer.connect();
})

@@ -29,3 +33,3 @@

data = Buffer.concat([buf, data], buf.length + data.length);
var leftover = await consumer.read({data, trunk: this.trunk, options});
var leftover = await this.consumer.read({data, trunk: this.trunk, options: this.opts});

@@ -32,0 +36,0 @@ if(leftover && leftover.length) {

class Message {
constructor() {
constructor(data) {
console.log('ORIG CONSTRUCTOR');
this.trunk = data.trunk;
}

@@ -4,0 +6,0 @@ }

@@ -20,5 +20,4 @@ var path = require('path');

var buf = Buffer.concat([]);
var accept = {socket, options};
socks.push(socket);
var trunk = await consumer.acceptChain(accept);
var trunk = await consumer.acceptChain({socket, options});

@@ -28,5 +27,4 @@ socket.on('data', async (data) => {

console.log('SOCKET data:'+data.length+', buf:' + Buffer.byteLength(buf));
// data = buf + data.toString();
data = Buffer.concat([buf, data], buf.length + data.length);
var leftover = await trunk.read({data, trunk, options})
var leftover = await consumer.read({data, trunk, options})

@@ -33,0 +31,0 @@ if(leftover && leftover.length) {

@@ -0,4 +1,7 @@

var Protocol = require('./protocol');
class Trunk {
constructor(opts) {
this.options = opts;
this.protocol = new Protocol();
}

@@ -27,4 +30,12 @@

}
send(msg) {
this.socket.write(this.protocol.createMessage(msg.headers, msg.content))
}
reply(headers, content) {
this.socket.write(this.protocol.createMessage(headers, content))
}
}
module.exports = Trunk;

@@ -42,2 +42,4 @@ var util = require('util');

incoming({id, msg, trunk}) {
console.log('INCOMING:',id, typeof msg.reply);
if(id) {

@@ -47,5 +49,7 @@ var trans = this.req.get(id);

if(trans) {
console.log('TRNS');
var entry = trans.table.get(id);
if(entry) {
console.log('ENTRY');
entry.counter--;

@@ -52,0 +56,0 @@ entry.resp.push(msg);

@@ -59,3 +59,3 @@ {

"optionalDependencies": {},
"version": "0.1.5",
"version": "0.1.6",
"directories": {

@@ -62,0 +62,0 @@ "lib": "lib"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc