cors_enabler 0.9.0
cors_enabler: ^0.9.0 copied to clipboard
A CORS proxy to make any API server CORS-compliant.
A tiny CORS proxy written in Dart.
The library provides a CorsProxy that listens for requests and forwards them to the remote URL provided when instantiating a proxy instance.
The proxy will add permissive CORS headers so that browsers can access the proxied resources.
Usage #
Run from the project root:
dart run bin/cors.dart https://api.target.com/ 8080
Then request:
http://localhost:8080/path/to/resource
Notes #
- The proxy supports preflight OPTIONS requests and adds some CORS response headers such as
Access-Control-Allow-Origin. - Be warned! It is designed for demonstration and development use; it does not implement advanced security checks or access restrictions.