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

peerface

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peerface - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1-a

1

lib/Client.js

@@ -43,2 +43,3 @@ /*jshint node: true */

port: port,
allowHalfOpen: true
}, function() {

@@ -45,0 +46,0 @@ resolve(new PeerConnection(socket));

4

lib/dto/BaseRequestMessage.js

@@ -51,5 +51,3 @@ /*jshint node: true */

this.begin = bytes.readInt32BE(9);
this.length = bytes.readInt32BE(13);
this.length = bytes.readInt32BE(13);
}

@@ -56,0 +54,0 @@ };

@@ -35,3 +35,3 @@ /*jshint node: true */

_reserved: {
value: new Buffer([0,0,0,0,0,0,0])
value: new Buffer([0,0,0,0,0,0,0,0])
},

@@ -38,0 +38,0 @@ _infoHash: {

@@ -116,3 +116,3 @@ /*jshint node: true */

PeerConnection.prototype.handshake = function(peerId) {
PeerConnection.prototype.handshake = function(peerId, infoHash) {
// create the message

@@ -124,3 +124,6 @@ var msg = new Messages.Handshake();

msg.infoHash = infoHash;
// send the message
console.log(this._socket);
this._socket.end(msg.toBuffer());

@@ -127,0 +130,0 @@ };

{
"name": "peerface",
"version": "0.0.0",
"version": "0.0.1a",
"description": "bittorrent peer communication library",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,5 +16,7 @@ /*jshint node: true */

peerId = crypto.randomBytes(10).toString('hex');
var pstrlen = new Buffer(1);
pstrlen.writeUInt8(19,0);
var bytes = Buffer.concat([
// pstrlen
new Buffer([19]),
pstrlen,
// pstr

@@ -30,2 +32,3 @@ new Buffer('BitTorrent protocol'),

console.log(new Buffer(peerId).length, bytes.length, 19+49);
var msg = new lib.Messages.Handshake(bytes);

@@ -37,3 +40,3 @@

t.equal(msg.peerId, peerId, "peer_ids should match");
t.deepEqual(msg.toBuffer(),bytes, "buffers should match");
t.end();

@@ -40,0 +43,0 @@

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