Index: net/data/websocket/connect_to.html |
diff --git a/net/data/websocket/connect_check.html b/net/data/websocket/connect_to.html |
similarity index 64% |
copy from net/data/websocket/connect_check.html |
copy to net/data/websocket/connect_to.html |
index 8d8e815b114c8822fbf517eef375ea1575733ce0..05c653fc5d2ab9a333efea5b4c5eee83a03bbe07 100644 |
--- a/net/data/websocket/connect_check.html |
+++ b/net/data/websocket/connect_to.html |
@@ -3,8 +3,16 @@ |
<head> |
<title>test ws connection</title> |
<script type="text/javascript"> |
-var protocol = location.protocol.replace('http', 'ws'); |
-var url = protocol + '//' + location.host + '/echo-with-no-extension'; |
+ |
+var href = window.location.href; |
+var queryBegin = href.indexOf('?url='); |
+if (queryBegin == -1) { |
+ console.log("Failed to find ?url= in URL"); |
+ document.title = 'FAIL'; |
+ throw "FAILURE"; |
+} |
+var url = href.slice(queryBegin + 5); |
+ |
// Do connection test. |
var ws = new WebSocket(url); |