borah / cors-proxy
Bypass CORS issues when developing locally with no hassle.
Requires
- php: ^8.1
- amphp/amp: ^3.0
- amphp/http: ^2.1
- amphp/http-server: ^3.3
- amphp/http-server-form-parser: ^2.0
- amphp/http-server-router: ^2.0
- amphp/log: ^2.0
- guzzlehttp/guzzle: ^7.5
- illuminate/http: ^10.0
- nunomaduro/termwind: ^1.15.1
- revolt/event-loop: ^1.0
Requires (Dev)
- laravel-zero/framework: ^10.2
- laravel/pint: ^1.13
- mockery/mockery: ^1.6
- pestphp/pest: ^2.22
README
CORS Proxy is a CLI tool based on Laravel Zero and it's extremely useful to remove all the CORS errors you might have when developing locally.
Why
Unfortunately we don't always have the luxury of having access to the back-end or the ability to change the CORS headers. This tool will help you to bypass that issue.
Requirements
To use CORS Proxy, you need to have PHP 8.1+ installed on your computer. Also, you need to have Composer installed.
Installation
To install CORS Proxy, you need to run the following command:
composer global require borah/cors-proxy
Usage
The usage is pretty simple. This is the command structure:
cors-proxy <host> {--headers=} {--port=1337}
The host
argument is the URL of the host you want to proxy. The --headers
option should be a JSON with default headers to send in all requests. The --port
option is used to specify the port you want to use for the proxy server.
Example
cors-proxy "https://httpbin.org"
This command will start the proxy server on port 1337 and will proxy all requests to https://httpbin.org
.
curl -X GET "http://localhost:1337/get?foo=bar&baz=qux" -H "x-custom-header: custom value"
Borah Digital Labs
Borah Digital Labs crafts web applications, open-source packages, and offers a team of full-stack solvers ready to tackle your next project. We have built a series of projects:
- CodeDocumentation: Automatic code documentation platform
- AutomaticDocs: One-time documentation for your projects
- Talkzy: A tool to summarize meetings
- Compass: An agent-driven tool to help manage companies more efficiently
- Prompt Token Counter: Simple tool to count tokens in prompts
- Sabor en la Oficina: Website + catering management platform
- Prompt Token Counter: Simple free tool to count tokens in prompts
- PDF to Markdown: Simple free tool to convert PDF files into Markdown format
We like to use Laravel for most of our projects and we love to tackle big, complicated problems. Feel free to reach out and we can have a virtual coffee!
We like to use Laravel for most of our projects and we love to tackle big, complicated problems. Feel free to reach out and we can have a virtual coffee!