Chromium Code Reviews| Index: tools/testing/dart/http_server.dart |
| diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart |
| index 08c26f6caf21de28d732d3810a75339efeb45b13..afef0d0028fd6f74ed74467b50a327edfd8fb971 100644 |
| --- a/tools/testing/dart/http_server.dart |
| +++ b/tools/testing/dart/http_server.dart |
| @@ -132,6 +132,8 @@ class TestingServers { |
| httpServer.listen((HttpRequest request) { |
| if (request.uri.path == "/echo") { |
| _handleEchoRequest(request, request.response); |
| + } else if (request.uri.path == '/ws') { |
|
kustermann
2013/03/19 12:13:43
Please add '/ws' to the description of the http se
blois
2013/03/20 21:05:17
Done.
|
| + _handleWebSocketRequest(request); |
| } else { |
| _handleFileOrDirectoryRequest( |
| request, request.response, allowedPort); |
| @@ -186,6 +188,15 @@ class TestingServers { |
| }); |
| } |
| + void _handleWebSocketRequest(HttpRequest request) { |
| + WebSocketTransformer.upgrade(request).then((websocket) { |
|
Søren Gjesse
2013/03/19 12:31:13
There should be a catchError (with some print stat
blois
2013/03/20 21:05:17
Done.
|
| + websocket.listen((data) { |
| + websocket.send(data); |
| + websocket.close(); |
|
Søren Gjesse
2013/03/19 12:31:13
There should also be an onError handler here to av
blois
2013/03/20 21:05:17
Done.
|
| + }); |
| + }); |
| + } |
| + |
| Path _getFilePathFromRequestPath(String urlRequestPath) { |
| // Go to the top of the file to see an explanation of the URL path scheme. |
| var requestPath = new Path(urlRequestPath.substring(1)).canonicalize(); |