Skip to content

undefinederror/verybasic-http-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

verybasic-http-proxy

A very basic http proxy in nodejs.

You may use it to quickly get around CORS limitations for APIs you want to query from browser

Installation

npm i verybasic-http-proxy

Starting the proxy

using the cli

with global install

verybasic-http-proxy --port 5555

with local install

npx verybasic-http-proxy --port 5555

via package.json scripts

"scripts": {
    "proxy": "verybasic-http-proxy --port 5555"
}

from script

const createProxy = require('verybasic-http-proxy')
createProxy(5555)

Port is optional, default is 5555

Forwarding requests

Prepend the proxy url to your request, for instance

http://localhost:5555/https://www.someapi.com?par=val

All your request headers and data are forwarded.

The only hardcoded request headers are Host, Origin and Referer so to match the requested api.

Response headers will include

 access-control-allow-headers: *
 access-control-allow-origin: *
 access-control-allow-methods: *

About

A very basic http proxy in nodejs

Resources

License

Unknown, WTFPL licenses found

Licenses found

Unknown
LICENSE
WTFPL
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published