Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: pkg/http_multi_server/README.md

Issue 317803003: Add a LICENSE file to pkg/http_multi_server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/http_multi_server/LICENSE ('k') | pkg/http_multi_server/lib/http_multi_server.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 An implementation of `dart:io`'s [HttpServer][] that wraps multiple servers and
2 forwards methods to all of them. It's useful for serving the same application on
3 multiple network interfaces while still having a unified way of controlling the
4 servers. In particular, it supports serving on both the IPv4 and IPv6 loopback
5 addresses using [HttpMultiServer.loopback][].
6
7 ```dart
8 import 'package:http_multi_server/http_multi_server.dart';
9 import 'package:shelf/shelf.dart' as shelf;
10 import 'package:shelf/shelf_io.dart' as shelf_io;
11
12 void main() {
13 // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same
14 // server.
15 HttpMultiServer.loopback(8080).then((server) {
16 shelf_io.serveRequests(server, (request) {
17 return new shelf.Response.ok("Hello, world!");
18 });
19 });
20 }
21 ```
22
23 [HttpServer]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/da rt-io.HttpServer
24
25 [HttpMultiServer.loopback]: https://api.dartlang.org/apidocs/channels/stable/dar tdoc-viewer/http_multi_server/http_multi_server.HttpMultiServer#id_loopback
OLDNEW
« no previous file with comments | « pkg/http_multi_server/LICENSE ('k') | pkg/http_multi_server/lib/http_multi_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698