Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 Library of HTTP server classes. | |
| 2 | |
| 3 This package contains a set of high-level classes that, together with | |
| 4 HttpServer, makes is easy to provide content through HTTP servers. | |
| 5 | |
| 6 ## Virtual Directory | |
| 7 | |
| 8 The VirtualDirectory class makes it possible to easy serve static content from t he | |
|
Søren Gjesse
2013/10/21 09:00:05
Long line.
Anders Johnsen
2013/10/21 09:19:48
Done.
| |
| 9 drive. It supports | |
|
Søren Gjesse
2013/10/21 09:00:05
Colon after suports.
Anders Johnsen
2013/10/21 09:19:48
Done.
| |
| 10 | |
| 11 * Range-based request, making it possible to pause/resume downloads and stream | |
| 12 videos. | |
| 13 * If-Modified-Since based caching. | |
| 14 * Automatic GZip-compression of content. | |
| 15 * Ability to follow links within, either throughout the system or in a jailed | |
| 16 root. | |
| 17 * Optional directory listing. | |
| 18 | |
| 19 The following example shows how to set up a Virtual Directory of a given path | |
| 20 | |
| 21 var virtualDirectory = new VirtualDirectory('/var/www/'); | |
| 22 virtualDirectory.serve(new HttpServer('0.0.0.0', 8080)); | |
| 23 | |
| 24 See [VirtualDirectory](http://api.dartlang.org/docs/http_server/VirtualDirectory .html) for more info about how to customize the class. | |
|
Søren Gjesse
2013/10/21 09:00:05
Can this line be broken?
Anders Johnsen
2013/10/21 09:19:48
Done.
| |
| 25 | |
| 26 ## Virtual Host | |
| 27 | |
| 28 The VirtualHost class makes it possible to serve multiple hosts on the same | |
| 29 address, by using the `Host` field of the incoming requests. It also provides | |
| 30 the ability to work on wildcards for sub-domains. | |
| 31 | |
| 32 var virtualHost = new VirtualHost(server); | |
| 33 // Filter out on a specific host | |
| 34 var stream1 = virtualServer.addHost('static.myserver.com'); | |
| 35 // Wildcard for any other sub-domains. | |
| 36 var stream2 = virtualServer.addHost('*.myserver.com'); | |
| 37 // Requets not matching any hosts. | |
| 38 var stream3 = virtualServer.unhandled; | |
| 39 | |
| 40 See [VirtualHost](http://api.dartlang.org/docs/http_server/VirtualHost.html) for more information. | |
| OLD | NEW |