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

@libp2p/autonat

Package Overview
Dependencies
Maintainers
0
Versions
451
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/autonat - npm Package Compare versions

Comparing version 2.0.14 to 2.0.15-20d9ba73e

1

dist/src/autonat.d.ts

@@ -11,2 +11,3 @@ import { serviceCapabilities, serviceDependencies } from '@libp2p/interface';

private readonly maxOutboundStreams;
private readonly maxMessageSize;
private started;

@@ -13,0 +14,0 @@ private readonly log;

8

dist/src/autonat.js

@@ -13,3 +13,3 @@ import { serviceCapabilities, serviceDependencies, setMaxListeners } from '@libp2p/interface';

import * as Digest from 'multiformats/hashes/digest';
import { DEFAULT_CONNECTION_THRESHOLD, MAX_INBOUND_STREAMS, MAX_OUTBOUND_STREAMS, PROTOCOL_NAME, PROTOCOL_PREFIX, PROTOCOL_VERSION, TIMEOUT } from './constants.js';
import { DEFAULT_CONNECTION_THRESHOLD, MAX_INBOUND_STREAMS, MAX_MESSAGE_SIZE, MAX_OUTBOUND_STREAMS, PROTOCOL_NAME, PROTOCOL_PREFIX, PROTOCOL_VERSION, TIMEOUT } from './constants.js';
import { Message } from './pb/index.js';

@@ -27,2 +27,3 @@ // if more than 3 peers manage to dial us on what we believe to be our external

maxOutboundStreams;
maxMessageSize;
started;

@@ -44,2 +45,3 @@ log;

this.connectionThreshold = init.connectionThreshold ?? DEFAULT_CONNECTION_THRESHOLD;
this.maxMessageSize = init.maxMessageSize ?? MAX_MESSAGE_SIZE;
this.dialResults = new Map();

@@ -147,3 +149,5 @@ this.findPeers = repeatingTask(this.findRandomPeers.bind(this), 60_000);

setMaxListeners(Infinity, signal);
const messages = pbStream(data.stream).pb(Message);
const messages = pbStream(data.stream, {
maxDataLength: this.maxMessageSize
}).pb(Message);
try {

@@ -150,0 +154,0 @@ const request = await messages.read({

@@ -14,5 +14,6 @@ /**

export declare const TIMEOUT = 30000;
export declare const MAX_INBOUND_STREAMS = 1;
export declare const MAX_OUTBOUND_STREAMS = 1;
export declare const MAX_INBOUND_STREAMS = 2;
export declare const MAX_OUTBOUND_STREAMS = 20;
export declare const DEFAULT_CONNECTION_THRESHOLD = 80;
export declare const MAX_MESSAGE_SIZE = 8192;
//# sourceMappingURL=constants.d.ts.map

@@ -14,5 +14,6 @@ /**

export const TIMEOUT = 30000;
export const MAX_INBOUND_STREAMS = 1;
export const MAX_OUTBOUND_STREAMS = 1;
export const MAX_INBOUND_STREAMS = 2;
export const MAX_OUTBOUND_STREAMS = 20;
export const DEFAULT_CONNECTION_THRESHOLD = 80;
export const MAX_MESSAGE_SIZE = 8192;
//# sourceMappingURL=constants.js.map

@@ -69,2 +69,9 @@ /**

connectionThreshold?: number;
/**
* How large incoming autonat messages are allowed to be in bytes. If messages
* larger than this are received the stream will be reset.
*
* @default 8192
*/
maxMessageSize?: number;
}

@@ -71,0 +78,0 @@ export interface AutoNATComponents {

{
"name": "@libp2p/autonat",
"version": "2.0.14",
"version": "2.0.15-20d9ba73e",
"description": "Implementation of Autonat Protocol",

@@ -55,7 +55,7 @@ "license": "Apache-2.0 OR MIT",

"dependencies": {
"@libp2p/interface": "^2.3.0",
"@libp2p/interface-internal": "^2.2.1",
"@libp2p/peer-collections": "^6.0.13",
"@libp2p/peer-id": "^5.0.9",
"@libp2p/utils": "^6.3.0",
"@libp2p/interface": "2.3.0-20d9ba73e",
"@libp2p/interface-internal": "2.2.1-20d9ba73e",
"@libp2p/peer-collections": "6.0.13-20d9ba73e",
"@libp2p/peer-id": "5.0.9-20d9ba73e",
"@libp2p/utils": "6.3.0-20d9ba73e",
"@multiformats/multiaddr": "^12.3.3",

@@ -69,4 +69,4 @@ "any-signal": "^4.1.1",

"devDependencies": {
"@libp2p/crypto": "^5.0.8",
"@libp2p/logger": "^5.1.5",
"@libp2p/crypto": "5.0.8-20d9ba73e",
"@libp2p/logger": "5.1.5-20d9ba73e",
"aegir": "^45.0.5",

@@ -73,0 +73,0 @@ "it-all": "^3.0.6",

@@ -13,6 +13,3 @@ import { serviceCapabilities, serviceDependencies, setMaxListeners } from '@libp2p/interface'

import * as Digest from 'multiformats/hashes/digest'
import {
DEFAULT_CONNECTION_THRESHOLD,
MAX_INBOUND_STREAMS, MAX_OUTBOUND_STREAMS, PROTOCOL_NAME, PROTOCOL_PREFIX, PROTOCOL_VERSION, TIMEOUT
} from './constants.js'
import { DEFAULT_CONNECTION_THRESHOLD, MAX_INBOUND_STREAMS, MAX_MESSAGE_SIZE, MAX_OUTBOUND_STREAMS, PROTOCOL_NAME, PROTOCOL_PREFIX, PROTOCOL_VERSION, TIMEOUT } from './constants.js'
import { Message } from './pb/index.js'

@@ -93,2 +90,3 @@ import type { AutoNATComponents, AutoNATServiceInit } from './index.js'

private readonly maxOutboundStreams: number
private readonly maxMessageSize: number
private started: boolean

@@ -111,2 +109,3 @@ private readonly log: Logger

this.connectionThreshold = init.connectionThreshold ?? DEFAULT_CONNECTION_THRESHOLD
this.maxMessageSize = init.maxMessageSize ?? MAX_MESSAGE_SIZE
this.dialResults = new Map()

@@ -235,3 +234,5 @@ this.findPeers = repeatingTask(this.findRandomPeers.bind(this), 60_000)

const messages = pbStream(data.stream).pb(Message)
const messages = pbStream(data.stream, {
maxDataLength: this.maxMessageSize
}).pb(Message)

@@ -238,0 +239,0 @@ try {

@@ -16,4 +16,5 @@ /**

export const TIMEOUT = 30000
export const MAX_INBOUND_STREAMS = 1
export const MAX_OUTBOUND_STREAMS = 1
export const MAX_INBOUND_STREAMS = 2
export const MAX_OUTBOUND_STREAMS = 20
export const DEFAULT_CONNECTION_THRESHOLD = 80
export const MAX_MESSAGE_SIZE = 8192

@@ -78,2 +78,10 @@ /**

connectionThreshold?: number
/**
* How large incoming autonat messages are allowed to be in bytes. If messages
* larger than this are received the stream will be reset.
*
* @default 8192
*/
maxMessageSize?: number
}

@@ -80,0 +88,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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