commit | fabc6a980412d34b1ce3f6b1e2e683816b3c7fe7 | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@google.com> | Thu Jul 18 09:51:55 2019 -0700 |
committer | Kevin Moore <kevmoo@users.noreply.github.com> | Thu Jul 18 09:57:33 2019 -0700 |
tree | 6d69694cd50339292b4d1f74368e63a2c53c860c | |
parent | f1979e721b4b28256927eb7e3871bf0312c5011d [diff] |
Add example/example.dart Update code in README
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() async { var server = await shelf_io.serve( proxyHandler("https://dart.dev"), 'localhost', 8080, ); print('Proxying at http://${server.address.host}:${server.port}'); }