https://github.com/thxi/bypass-cors
an standalone service app to bypass CORS
https://github.com/thxi/bypass-cors
cors cors-anywhere cors-proxy docker
Last synced: 5 months ago
JSON representation
an standalone service app to bypass CORS
- Host: GitHub
- URL: https://github.com/thxi/bypass-cors
- Owner: thxi
- License: mit
- Created: 2020-08-05T08:31:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T19:17:46.000Z (over 3 years ago)
- Last Synced: 2024-06-20T20:34:16.615Z (almost 2 years ago)
- Topics: cors, cors-anywhere, cors-proxy, docker
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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](https://github.com/rs/zerolog) for logging
- [rs/cors](https://github.com/rs/cors) for handling cors
## Example
The app is deployed to [heroku](https://cors-proxy-io.herokuapp.com)
```javascript
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
```bash
go run .
# or with flags
go run . -pp -p 8080
```
### Docker
To build the image locally:
```bash
make docker-build
```
To run it locally:
```bash
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)