Socket
Socket
Sign inDemoInstall

ssrp

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

6

lib/index.d.ts

@@ -24,7 +24,1 @@ import Instance from './instance';

}): Promise<Instance[]>;
export declare function listAllInstances({ port, family, signal, timeout }: {
port?: number;
family: 4 | 6;
timeout?: number;
signal?: AbortSignal;
}): Promise<Instance[]>;

39

lib/index.js

@@ -10,3 +10,2 @@ "use strict";

exports.listInstances = listInstances;
exports.listAllInstances = listAllInstances;
Object.defineProperty(exports, "Instance", {

@@ -61,3 +60,3 @@ enumerable: true,

family
}, port, false, timeout, request, signal);
}, port, timeout, request, signal);

@@ -93,3 +92,3 @@ if (!response) {

family
}, port, false, timeout, request, signal);
}, port, timeout, request, signal);

@@ -105,33 +104,2 @@ if (!response) {

function listAllInstances(_x4) {
return _listAllInstances.apply(this, arguments);
}
function _listAllInstances() {
_listAllInstances = (0, _asyncToGenerator2.default)(function* ({
port = DEFAULT_PORT,
family,
signal,
timeout = DEFAULT_TIMEOUT
}) {
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
throw new Error('aborted');
}
const address = family === 6 ? 'FF02::1' : '255.255.255.255';
const request = Buffer.from([0x02]);
const response = yield sendRequest({
address,
family
}, port, true, timeout, request, signal);
if (!response) {
return [];
}
return parseResponse(response);
});
return _listAllInstances.apply(this, arguments);
}
function parseResponse(buffer) {

@@ -147,3 +115,3 @@ if (buffer.readUInt8(0) !== 0x05) {

function sendRequest(address, port, broadcast, timeout, request, signal) {
function sendRequest(address, port, timeout, request, signal) {
const socketType = address.family === 6 ? 'udp6' : 'udp4';

@@ -194,3 +162,2 @@

socket.on('message', onMessage);
socket.setBroadcast(broadcast);
socket.send(request, 0, request.length, port, address.address, err => {

@@ -197,0 +164,0 @@ if (err) {

2

package.json
{
"name": "ssrp",
"description": "An implementation of the SQL Server Resolution protocol.",
"version": "2.0.0",
"version": "3.0.0",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "types": "lib/index.d.ts",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc