Skip to content

alihm/corsproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

CORS Proxy

A lightweight CORS proxy built with Node.js. Zero external dependencies.

Usage

npm start

The server starts on port 8080 by default. Set the PORT environment variable to change it.

Endpoints

Proxy a request

Query param style:

GET http://localhost:8080/?url=https://example.com/api/data

Path-based style:

GET http://localhost:8080/https://example.com/api/data

Both styles support all HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD). Request headers and body are forwarded to the target.

Health check

GET http://localhost:8080/health

Returns {"status":"ok"}.

Example

// Browser fetch that would normally be blocked by CORS
const response = await fetch("http://localhost:8080/?url=https://api.example.com/data");
const data = await response.json();

Configuration

Variable Default Description
PORT 8080 Port the server listens on

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors