add support for all ports

This commit is contained in:
加里
2014-09-18 13:36:27 +08:00
parent e6da97a098
commit f5448677ac
7 changed files with 50 additions and 17 deletions

View File

@@ -14,7 +14,7 @@
<a href="#" class="J_clearBtn"><span class="topBtn">Clear Logs(Ctrl+X)</span></a>
<a href="#" class="J_statusBtn"><span class="topBtn">Stop</span></a>
<a href="#" class="J_statusBtn btn_disable"><span class="topBtn">Resume</span></a>
<a href="http://localhost:8080"><span class="topBtn">Config Local Response(beta)</span></a>
<a href="http://localhost:{{proxyConfigPort}}"><span class="topBtn">Config Local Response(beta)</span></a>
</div>
<div class="ruleDesc">
<h4>rule : <strong>{{rule}}</strong></h4>
@@ -44,6 +44,8 @@
</div>
</div>
<input type="hidden" id="socketPort" value="{{webSocketPort}}" />
<script type="text/template" id="main_table_row">
<td class="data_id"><%= _id %></td>
<td><%= method %></td>

View File

@@ -176,7 +176,8 @@ seajs.use(['$','Underscore' ,'Backbone'], function($, _, Backbone) {
alert("WebSocket is required. Please use a modern browser.");
return;
}
var dataSocket = new WebSocket("ws://127.0.0.1:8003");
var socketPort = $("#socketPort").val() || "8003",
dataSocket = new WebSocket("ws://127.0.0.1:" + socketPort);
dataSocket.onopen = function(){}
dataSocket.onmessage = function(event){