A server app built using Shelf, configured to enable running with Docker.
This sample code handles HTTP GET requests to /
and /echo/<message>
You can run the example with the Dart SDK like this:
$ dart run bin/server.dart
Server listening on port 3000
And then from a second terminal:
$ curl http://0.0.0.0:3000/https://google.com
(the google page)
If you have Docker Desktop installed, you
can build and run with the docker
command:
$ docker build . -t dart_cors_proxy
$ docker run -it -p 3000:3000 myserver
Server listening on port 3000
And then from a second terminal:
$ curl http://0.0.0.0:3000/https://google.com
(the google page)