Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuzulul/opencors
OpenCORS is a simple NodeJS based CORS Proxy
https://github.com/nuzulul/opencors
cors cors-proxy cross-domain cross-origin node node-js nodejs opencors proxy scraper
Last synced: about 1 month ago
JSON representation
OpenCORS is a simple NodeJS based CORS Proxy
- Host: GitHub
- URL: https://github.com/nuzulul/opencors
- Owner: nuzulul
- License: mit
- Created: 2024-01-11T04:09:12.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-03T12:18:58.000Z (11 months ago)
- Last Synced: 2024-09-19T01:50:48.333Z (3 months ago)
- Topics: cors, cors-proxy, cross-domain, cross-origin, node, node-js, nodejs, opencors, proxy, scraper
- Language: JavaScript
- Homepage: https://codesandbox.io/p/devbox/nodejs-cors-proxy-xqsqwg
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenCORS
**OpenCORS** is a simple NodeJS based CORS Proxy
[![NPM](https://nodei.co/npm/opencors.png?mini=true)](https://www.npmjs.com/package/opencors)
[![npm version](https://badge.fury.io/js/opencors.svg)](https://www.npmjs.com/package/opencors)## Features
* ✅ 0 Dependencies
* ✅ Follow redirects
* ✅ Plain output
* ✅ SSL## Qiuck Start
### Local
```javascript
git clone https://github.com/nuzulul/opencors.git
npm install
npm start
```### Deploy
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnuzulul%2Fopencors&project-name=corsproxy&repository-name=corsproxy)
## Demo
[https://codesandbox.io/p/devbox/nodejs-cors-proxy-xqsqwg](https://codesandbox.io/p/devbox/nodejs-cors-proxy-xqsqwg)
## Installation
```javascript
npm install opencors
```## Example Usage
### Server (NodeJS)
```javascript
import {OpenCORS} from 'opencors'const server = new OpenCORS({
//port:4000,
//front: 'opencors
'
})
```
```javascript
const {OpenCORS} = require('opencors')const server = new OpenCORS({
//port:4000,
//front: 'opencors
'
})
```
Request examples:* `https://xqsqwg-8080.csb.app/?url=https://www.google.com/` - Raw Google.com with CORS headers
### Client (Browser)
```javascript
fetch('https://xqsqwg-8080.csb.app/?url=https://www.google.com/').then(function (response){
return response.text()
}).then(function (html){
console.log(html)
}).catch(function (err){
console.warn('Something went wrong.',err)
})
```## License
MIT