Registry / security / socks5-node-fetch

socks5-node-fetch

JSON →
library0.0.4jsnpmunverified

A thin wrapper around node-fetch that adds SOCKS5 proxy support via a custom agent. Version 0.0.4, last updated in 2018. It provides a drop-in replacement for node-fetch that routes HTTP/HTTPS requests through a SOCKS5 proxy. Key differentiator: automatic protocol detection for http and https. Lightweight with no additional runtime dependencies beyond node-fetch. Limited to Node.js; no browser support. Stable but minimal maintenance.

npm install socks5-node-fetch
INSTALL
IMPORT
SIG · SOCKS5-NODE-FETCH
S
socks5-node-fetch
securityjavascriptv0.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import wrappedFetch from 'socks5-node-fetch'
const { wrappedFetch } = require('socks5-node-fetch')
Package has a default export, not named; CommonJS users can use `const wrappedFetch = require('socks5-node-fetch')`.
types
No TypeScript types bundled; users must install @types/node-fetch separately if using TypeScript.

Demonstrates importing socks5-node-fetch, configuring it with a SOCKS5 proxy, and making an HTTPS request.

import wrappedFetch from 'socks5-node-fetch'; const fetch = wrappedFetch({ socksHost: 'localhost', socksPort: '1080' }); fetch('https://httpbin.org/ip', { method: 'GET' }) .then(res => res.text()) .then(body => console.log('Response:', body)) .catch(err => console.error('Error:', err));
Debug
Known issues
gotchaPackage requires node-fetch as a peer dependency; must be installed separately.
fix
Run `npm install node-fetch socks5-node-fetch`
affects: >=0.0.0
gotchaOnly supports Node.js; will not work in browser environments.
fix
Use a browser-compatible fetch with SOCKS5 proxy support like 'socks-proxy-agent'.
affects: >=0.0.0
deprecatedLast published 7 years ago; no updates or security patches.
fix
Consider using 'socks-proxy-agent' directly with node-fetch for up-to-date package.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'socks5-node-fetch'
Package not installed.
fix
Run `npm install socks5-node-fetch`
TypeError: wrappedFetch is not a function
Incorrect import (named instead of default).
fix
Use `const wrappedFetch = require('socks5-node-fetch')` or `import wrappedFetch from 'socks5-node-fetch'`
Error: connect ECONNREFUSED 127.0.0.1:1080
SOCKS5 proxy not running or incorrect host/port.
fix
Ensure a SOCKS5 proxy is running at the specified host and port, or adjust the configuration.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
node-fetchrequiredRequired peer dependency; wraps node-fetch's fetch function.
Agent activity
19 hits · last 30 days
node
18
Resources
socks5-node-fetch — npm install socks5-node-fetch · libregistry