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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 * | 102 * |
103 * main() { | 103 * main() { |
104 * SecurityContext context = new SecurityContext(); | 104 * SecurityContext context = new SecurityContext(); |
105 * var chain = | 105 * var chain = |
106 * Platform.script.resolve('certificates/server_chain.pem') | 106 * Platform.script.resolve('certificates/server_chain.pem') |
107 * .toFilePath(); | 107 * .toFilePath(); |
108 * var key = | 108 * var key = |
109 * Platform.script.resolve('certificates/server_key.pem') | 109 * Platform.script.resolve('certificates/server_key.pem') |
110 * .toFilePath(); | 110 * .toFilePath(); |
111 * context.useCertificateChain(chain); | 111 * context.useCertificateChain(chain); |
112 * context.usePrivateKey(key, password: 'dartdart'); | 112 * context.usePrivateKeyBytes(keyBytes, password: 'dartdart'); |
113 * | 113 * |
114 * HttpServer | 114 * HttpServer |
115 * .bindSecure(InternetAddress.ANY_IP_V6, | 115 * .bindSecure(InternetAddress.ANY_IP_V6, |
116 * 443, | 116 * 443, |
117 * context) | 117 * context) |
118 * .then((server) { | 118 * .then((server) { |
119 * server.listen((HttpRequest request) { | 119 * server.listen((HttpRequest request) { |
120 * request.response.write('Hello, world!'); | 120 * request.response.write('Hello, world!'); |
121 * request.response.close(); | 121 * request.response.close(); |
122 * }); | 122 * }); |
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2024 class RedirectException implements HttpException { | 2024 class RedirectException implements HttpException { |
2025 final String message; | 2025 final String message; |
2026 final List<RedirectInfo> redirects; | 2026 final List<RedirectInfo> redirects; |
2027 | 2027 |
2028 const RedirectException(this.message, this.redirects); | 2028 const RedirectException(this.message, this.redirects); |
2029 | 2029 |
2030 String toString() => "RedirectException: $message"; | 2030 String toString() => "RedirectException: $message"; |
2031 | 2031 |
2032 Uri get uri => redirects.last.location; | 2032 Uri get uri => redirects.last.location; |
2033 } | 2033 } |
OLD | NEW |