| Index: sdk/lib/io/websocket.dart
|
| diff --git a/sdk/lib/io/websocket.dart b/sdk/lib/io/websocket.dart
|
| index a3f2b258e4d97fbf4e845491832d583ef7d9118f..f9229ae8e5afc6b9d32de18b27b0f5ddafc1b10f 100644
|
| --- a/sdk/lib/io/websocket.dart
|
| +++ b/sdk/lib/io/websocket.dart
|
| @@ -53,7 +53,9 @@ abstract class WebSocketStatus {
|
| */
|
| abstract class WebSocketTransformer
|
| implements StreamTransformer<HttpRequest, WebSocket> {
|
| - factory WebSocketTransformer() => new _WebSocketTransformerImpl();
|
| +
|
| + factory WebSocketTransformer({protocolSelector(List<String> protocols)})
|
| + => new _WebSocketTransformerImpl(protocolSelector);
|
|
|
| /**
|
| * Upgrades a [HttpRequest] to a [WebSocket] connection. If the
|
| @@ -62,8 +64,9 @@ abstract class WebSocketTransformer
|
| * future will complete with the [WebSocket] when the upgrade pocess
|
| * is complete.
|
| */
|
| - static Future<WebSocket> upgrade(HttpRequest request) {
|
| - return _WebSocketTransformerImpl._upgrade(request);
|
| + static Future<WebSocket> upgrade(HttpRequest request,
|
| + {protocolSelector(List<String> protocols)}) {
|
| + return _WebSocketTransformerImpl._upgrade(request, protocolSelector);
|
| }
|
|
|
| /**
|
| @@ -92,11 +95,11 @@ abstract class WebSocket implements Stream, StreamSink {
|
|
|
| /**
|
| * Create a new web socket connection. The URL supplied in [url]
|
| - * must use the scheme [:ws:] or [:wss:]. The [protocols] argument is either
|
| - * a [:String:] or [:List<String>:] specifying the subprotocols the
|
| - * client is willing to speak.
|
| + * must use the scheme [:ws:] or [:wss:]. The [protocols] argument is
|
| + * specifying the subprotocols the client is willing to speak.
|
| */
|
| - static Future<WebSocket> connect(String url, [protocols]) =>
|
| + static Future<WebSocket> connect(String url,
|
| + {List<String> protocols: const []}) =>
|
| _WebSocketImpl.connect(url, protocols);
|
|
|
| /**
|
|
|