Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: lib/src/runner/browser/server.dart

Issue 1145483003: Use http_multi_server for serving on localhost. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/server.dart
diff --git a/lib/src/runner/browser/server.dart b/lib/src/runner/browser/server.dart
index 5fbbf8ad35951ac545bd2d24d1ac7c1c29ee85e9..b49b18324b0365b2924790c2473427c52dc96e6b 100644
--- a/lib/src/runner/browser/server.dart
+++ b/lib/src/runner/browser/server.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
+import 'package:http_multi_server/http_multi_server.dart';
import 'package:path/path.dart' as p;
import 'package:pool/pool.dart';
import 'package:shelf/shelf.dart' as shelf;
@@ -144,7 +145,7 @@ class BrowserServer {
_compilers = new CompilerPool(color: color);
/// Starts the underlying server.
- Future _load() {
+ Future _load() async {
var cascade = new shelf.Cascade()
.add(_webSocketHandler.handler);
@@ -160,9 +161,8 @@ class BrowserServer {
.addMiddleware(nestingMiddleware(_secret))
.addHandler(cascade.handler);
- return shelf_io.serve(pipeline, 'localhost', 0).then((server) {
- _server = server;
- });
+ _server = await HttpMultiServer.loopback(0);
+ shelf_io.serveRequests(_server, pipeline);
}
/// Returns a handler that serves the contents of the "packages/" directory
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698