https://github.com/corebytee/simple-fetch-proxy
https://github.com/corebytee/simple-fetch-proxy
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/corebytee/simple-fetch-proxy
- Owner: CoreBytee
- License: mit
- Created: 2024-12-04T22:51:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-12T22:30:00.000Z (about 1 year ago)
- Last Synced: 2025-05-12T23:26:36.779Z (about 1 year ago)
- Language: TypeScript
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-fetch-proxy
A lightweight, configurable fetch proxy server. This package was created to allow proxying fetch requests through another server or IP.
## Features
- Forward HTTP requests to target servers
- Easy configuration
- Minimal dependencies
## Installation
Install via npm or bun:
```bash
npm install @corebyte/proxy
# or
bun add @corebyte/proxy
```
## Documentation
The package is fully written in TypeScript so you can use the type definitions as documentation. And you can also look at the code here on GitHub.
## Usage
Configure the server using env vars:
- `PROXY_PORT`: Host where the server listens
- `PROXY_SECRET`: Server secret
Start the proxy server:
```bash
npm run proxy [.env]
# or
bun run proxy [.env]
```
Create fetch function:
```js
import createFetch from "@corebyte/proxy";
const fetch = createFetch();
const response = await fetch("https://example.com");
console.log(await response.text());
```
## License
MIT License