
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
@mjackson/fetch-proxy
Advanced tools
fetch-proxy
is an HTTP proxy for the JavaScript Fetch API.
In the context of servers, an HTTP proxy server is a server that forwards all requests it receives to another server and returns the responses it receives. When you think about it this way, a fetch
function is like a mini proxy server sitting right there in your code. You send it requests, it goes and talks to some other server, and it gives you back the response it received.
fetch-proxy
allows you to easily create fetch
functions that act as proxies to "target" servers.
Set-Cookie
headers received from target serverX-Forwarded-Proto
and X-Forwarded-Host
headersfetch
implementationsInstall from npm:
npm i @mjackson/fetch-proxy
import { createFetchProxy } from '@mjackson/fetch-proxy';
// Create a proxy that sends all requests through to remix.run
let proxy = createFetchProxy('https://remix.run');
// This fetch handler is probably running as part of your server somewhere...
function handleFetch(request: Request): Promise<Response> {
return proxy(request);
}
// Test it out by manually throwing a Request at it
let response = await handleFetch(new Request('https://shopify.com'));
let text = await response.text();
let title = text.match(/<title>([^<]+)<\/title>/)[1];
assert(title.includes('Remix'));
node-fetch-server
- Build HTTP servers for Node.js using the web fetch APISee LICENSE
FAQs
An HTTP proxy for the web Fetch API
The npm package @mjackson/fetch-proxy receives a total of 1,561 weekly downloads. As such, @mjackson/fetch-proxy popularity was classified as popular.
We found that @mjackson/fetch-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.