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

Unified Diff: sdk/lib/_internal/pub/test/serve/utils.dart

Issue 311253005: Bind to all available loopback addresses in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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
Index: sdk/lib/_internal/pub/test/serve/utils.dart
diff --git a/sdk/lib/_internal/pub/test/serve/utils.dart b/sdk/lib/_internal/pub/test/serve/utils.dart
index 725c3b4c21e2564516b53cfa84e2cc38a440c361..a4763101fb94268f193fdf7ef74853e1ba29b063 100644
--- a/sdk/lib/_internal/pub/test/serve/utils.dart
+++ b/sdk/lib/_internal/pub/test/serve/utils.dart
@@ -144,7 +144,6 @@ ScheduledProcess startPubServe({Iterable<String> args,
var pubArgs = [
"serve",
"--port=0", // Use port 0 to get an ephemeral port.
- "--hostname=127.0.0.1", // Force IPv4 on bots.
"--force-poll",
"--log-admin-url"
];
@@ -206,9 +205,9 @@ ScheduledProcess pubServe({bool shouldGetFirst: false, bool createWebDir: true,
/// The regular expression for parsing pub's output line describing the URL for
/// the server.
-final _parsePortRegExp = new RegExp(r"([^ ]+) +on http://127\.0\.0\.1:(\d+)");
+final _parsePortRegExp = new RegExp(r"([^ ]+) +on http://localhost:(\d+)");
-/// Parses the port number from the "Running admin server on 127.0.0.1:1234"
+/// Parses the port number from the "Running admin server on localhost:1234"
/// line printed by pub serve.
bool _parseAdminPort(String line) {
var match = _parsePortRegExp.firstMatch(line);
@@ -217,7 +216,7 @@ bool _parseAdminPort(String line) {
return true;
}
-/// Parses the port number from the "Serving blah on 127.0.0.1:1234" line
+/// Parses the port number from the "Serving blah on localhost:1234" line
/// printed by pub serve.
bool _parsePort(String line) {
var match = _parsePortRegExp.firstMatch(line);
@@ -322,7 +321,7 @@ Future _ensureWebSocket() {
expect(_pubServer, isNotNull);
expect(_adminPort, isNotNull);
- return WebSocket.connect("ws://127.0.0.1:$_adminPort").then((socket) {
+ return WebSocket.connect("ws://localhost:$_adminPort").then((socket) {
_webSocket = socket;
// TODO(rnystrom): Works around #13913.
_webSocketBroadcastStream = _webSocket.map(JSON.decode).asBroadcastStream();
@@ -480,7 +479,7 @@ registerServerPort(String root, int port) {
String _getServerUrlSync([String root, String path]) {
if (root == null) root = 'web';
expect(_ports, contains(root));
- var url = "http://127.0.0.1:${_ports[root]}";
+ var url = "http://localhost:${_ports[root]}";
if (path != null) url = "$url/$path";
return url;
}

Powered by Google App Engine
This is Rietveld 408576698