| Index: sdk/lib/io/websocket_impl.dart
|
| diff --git a/sdk/lib/io/websocket_impl.dart b/sdk/lib/io/websocket_impl.dart
|
| index 65c4ca48f26b9907d7d47b1b469d6e41e53fc815..20ea830fb09131a6bb5b0a123f68a763021a0fe7 100644
|
| --- a/sdk/lib/io/websocket_impl.dart
|
| +++ b/sdk/lib/io/websocket_impl.dart
|
| @@ -767,7 +767,7 @@ class _WebSocketClientConnection
|
| class _WebSocket implements WebSocket {
|
| _WebSocket(String url, [protocols]) {
|
| Uri uri = new Uri.fromString(url);
|
| - if (uri.scheme != "ws") {
|
| + if (uri.scheme != "ws" && uri.scheme != "wss") {
|
| throw new WebSocketException("Unsupported URL scheme ${uri.scheme}");
|
| }
|
| if (uri.userInfo != "") {
|
| @@ -785,7 +785,12 @@ class _WebSocket implements WebSocket {
|
| }
|
|
|
| HttpClient client = new HttpClient();
|
| - HttpClientConnection conn = client.open("GET", uri.domain, port, path);
|
| + bool secure = (uri.scheme == 'wss');
|
| + HttpClientConnection conn = client.openUrl("GET",
|
| + new Uri.fromComponents(scheme: secure ? "https" : "http",
|
| + domain: uri.domain,
|
| + port: port,
|
| + path: path));
|
| if (protocols is String) protocols = [protocols];
|
| _wsconn = new WebSocketClientConnection(conn, protocols);
|
| _wsconn.onOpen = () {
|
|
|