bypass-cors

command module
v0.0.0-...-2baddac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 13 Imported by: 0

README

bypass-cors

A simple http server to bypass CORS origin request

Features:

  • all http methods are supported
  • forwards:
    • query parameters
    • headers
    • body
  • follows 3xx http redirects *
  • rs/zerolog for logging
  • rs/cors for handling cors

Example

The app is deployed to heroku

let resp = await fetch('https://cors-proxy-io.herokuapp.com/google.com');
// or, if the application is running locally
let resp = await fetch('http://localhost:3228/google.com');

or open https://cors-proxy-io.herokuapp.com/google.com in your web browser

Run

Flags
-p string
      server port (default "3228")
-pp
      enable pretty print
Locally
go run .
# or with flags
go run . -pp -p 8080
Docker

To build the image locally:

make docker-build

To run it locally:

make docker-run
# or, if you want to set the flags yourself
docker run -p 1337:1337 bypass-cors -p 1337 -pp

* These 3xx codes are followd:

  • 301 (Moved Permanently)
  • 302 (Found)
  • 303 (See Other)
  • 307 (Temporary Redirect)
  • 308 (Permanent Redirect)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL