commit | d4dfcdcf1a8c5458f7f271929d59064d834c502d | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@google.com> | Fri Feb 01 20:59:14 2019 -0800 |
committer | Kevin Moore <kevmoo@users.noreply.github.com> | Sat Feb 02 15:31:42 2019 -0800 |
tree | c12f5ed12c952ce22a44d01f4e629347e0c6ab45 | |
parent | 701956e23737b122e380de6ae85dd786c061e4d2 [diff] |
Removed outdated example – relied on `pub serve`
shelf_proxy
is a Shelf handler that proxies requests to an external server. It can be served directly and used as a proxy server, or it can be mounted within a larger application to proxy only certain URLs.
import 'package:shelf/shelf_io.dart' as shelf_io; import 'package:shelf_proxy/shelf_proxy.dart'; void main() { shelf_io.serve(proxyHandler("https://www.dartlang.org"), 'localhost', 8080) .then((server) { print('Proxying at http://${server.address.host}:${server.port}'); }); }