OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * HTTP status codes. | 8 * HTTP status codes. |
9 */ | 9 */ |
10 abstract class HttpStatus { | 10 abstract class HttpStatus { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 | 56 |
57 /** | 57 /** |
58 * HTTP server. | 58 * HTTP server. |
59 */ | 59 */ |
60 abstract class HttpServer implements Stream<HttpRequest> { | 60 abstract class HttpServer implements Stream<HttpRequest> { |
61 // TODO(ajohnsen): Document with example, once the stream API is final. | 61 // TODO(ajohnsen): Document with example, once the stream API is final. |
62 // TODO(ajohnsen): Add HttpServer.secure. | 62 // TODO(ajohnsen): Add HttpServer.secure. |
63 /** | 63 /** |
64 * Starts listening for HTTP requests on the specified [address] and | 64 * Starts listening for HTTP requests on the specified [address] and |
65 * [port]. If a [port] of 0 is specified the server will choose an | 65 * [port]. |
66 * ephemeral port. The optional argument [backlog] can be used to | 66 * |
67 * specify the listen backlog for the underlying OS listen | 67 * The default value for [address] is 127.0.0.1, which will allow |
68 * setup. | 68 * only incoming connections from the local host. To allow for |
| 69 * incoming connection from the network use either the value 0.0.0.0 |
| 70 * to bind to all interfaces or the IP address of a specific |
| 71 * interface. |
| 72 * |
| 73 * If [port] has the value [:0:] (the default) an ephemeral port |
| 74 * will be chosen by the system. The actual port used can be |
| 75 * retrieved using the [:port:] getter. |
| 76 * |
| 77 * The optional argument [backlog] can be used to specify the listen |
| 78 * backlog for the underlying OS listen setup. If [backlog] has the |
| 79 * value of [:0:] (the default) a reasonable value will be chosen by |
| 80 * the system. |
69 */ | 81 */ |
70 static Future<HttpServer> bind([String address = "127.0.0.1", | 82 static Future<HttpServer> bind([String address = "127.0.0.1", |
71 int port = 0, | 83 int port = 0, |
72 int backlog = 0]) | 84 int backlog = 0]) |
73 => _HttpServer.bind(address, port, backlog); | 85 => _HttpServer.bind(address, port, backlog); |
74 | 86 |
75 /** | 87 /** |
76 * Starts listening for HTTPS requests on the specified [address] and | 88 * Starts listening for HTTPS requests on the specified [address] and |
77 * [port]. If a [port] of 0 is specified the server will choose an | 89 * [port]. If a [port] of 0 is specified the server will choose an |
78 * ephemeral port. The optional argument [backlog] can be used to | 90 * ephemeral port. The optional argument [backlog] can be used to |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 class RedirectLimitExceededException extends RedirectException { | 1315 class RedirectLimitExceededException extends RedirectException { |
1304 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1316 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
1305 : super("Redirect limit exceeded", redirects); | 1317 : super("Redirect limit exceeded", redirects); |
1306 } | 1318 } |
1307 | 1319 |
1308 | 1320 |
1309 class RedirectLoopException extends RedirectException { | 1321 class RedirectLoopException extends RedirectException { |
1310 const RedirectLoopException(List<RedirectInfo> redirects) | 1322 const RedirectLoopException(List<RedirectInfo> redirects) |
1311 : super("Redirect loop detected", redirects); | 1323 : super("Redirect loop detected", redirects); |
1312 } | 1324 } |
OLD | NEW |