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

fetch-socks

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-socks - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

18

index.js

@@ -1,3 +0,7 @@

import { SocksClient } from "socks";
import { Agent, buildConnector } from "undici";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.socksConnector = socksConnector;
exports.socksDispatcher = socksDispatcher;
const socks_1 = require("socks");
const undici_1 = require("undici");
/**

@@ -20,6 +24,6 @@ * Since socks does not guess HTTP ports, we need to do that.

*/
export function socksConnector(proxies, tlsOpts = {}) {
function socksConnector(proxies, tlsOpts = {}) {
const chain = Array.isArray(proxies) ? proxies : [proxies];
const { timeout = 1e4 } = tlsOpts;
const undiciConnect = buildConnector(tlsOpts);
const undiciConnect = (0, undici_1.buildConnector)(tlsOpts);
return async (options, callback) => {

@@ -44,3 +48,3 @@ let { protocol, hostname, port, httpSocket } = options;

try {
const r = await SocksClient.createConnection(socksOpts);
const r = await socks_1.SocksClient.createConnection(socksOpts);
httpSocket = r.socket;

@@ -72,5 +76,5 @@ }

*/
export function socksDispatcher(proxies, options = {}) {
function socksDispatcher(proxies, options = {}) {
const { connect, ...rest } = options;
return new Agent({ ...rest, connect: socksConnector(proxies, connect) });
return new undici_1.Agent({ ...rest, connect: socksConnector(proxies, connect) });
}
{
"name": "fetch-socks",
"version": "1.3.1",
"version": "1.3.2",
"description": "Socks proxy for Node builtin `fetch`",

@@ -21,3 +21,2 @@ "license": "MIT",

],
"type": "module",
"main": "index.js",

@@ -24,0 +23,0 @@ "types": "index.d.ts",

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