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 * WebSocket status codes used when closing a WebSocket connection. | 8 * WebSocket status codes used when closing a WebSocket connection. |
9 */ | 9 */ |
10 abstract class WebSocketStatus { | 10 abstract class WebSocketStatus { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 * which are controlled by the WebSocket connection process. These | 140 * which are controlled by the WebSocket connection process. These |
141 * headers are: | 141 * headers are: |
142 * | 142 * |
143 * - `connection` | 143 * - `connection` |
144 * - `sec-websocket-key` | 144 * - `sec-websocket-key` |
145 * - `sec-websocket-protocol` | 145 * - `sec-websocket-protocol` |
146 * - `sec-websocket-version` | 146 * - `sec-websocket-version` |
147 * - `upgrade` | 147 * - `upgrade` |
148 * | 148 * |
149 * If any of these are passed in the `headers` map they will be ignored. | 149 * If any of these are passed in the `headers` map they will be ignored. |
| 150 * |
| 151 * If the `url` contains user information this will be passed as basic |
| 152 * authentication when setting up the connection. |
150 */ | 153 */ |
151 static Future<WebSocket> connect(String url, | 154 static Future<WebSocket> connect(String url, |
152 {Iterable<String> protocols, | 155 {Iterable<String> protocols, |
153 Map<String, dynamic> headers}) => | 156 Map<String, dynamic> headers}) => |
154 _WebSocketImpl.connect(url, protocols, headers); | 157 _WebSocketImpl.connect(url, protocols, headers); |
155 | 158 |
156 @Deprecated('This constructor will be removed in Dart 2.0. Use `implements`' | 159 @Deprecated('This constructor will be removed in Dart 2.0. Use `implements`' |
157 ' instead of `extends` if implementing this abstract class.') | 160 ' instead of `extends` if implementing this abstract class.') |
158 WebSocket(); | 161 WebSocket(); |
159 | 162 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 */ | 237 */ |
235 Future addStream(Stream stream); | 238 Future addStream(Stream stream); |
236 } | 239 } |
237 | 240 |
238 | 241 |
239 class WebSocketException implements IOException { | 242 class WebSocketException implements IOException { |
240 final String message; | 243 final String message; |
241 const WebSocketException([this.message = ""]); | 244 const WebSocketException([this.message = ""]); |
242 String toString() => "WebSocketException: $message"; | 245 String toString() => "WebSocketException: $message"; |
243 } | 246 } |
OLD | NEW |