Explicit listen on '0.0.0.0' in wsproxy. Proxy port number is configurable now.
diff --git a/.DS_Store b/.DS_Store
index 060a4a1..5d54f89 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/js/testing/test-get-async.html b/js/testing/test-get-async.html
index f93db6c..cd19c9c 100644
--- a/js/testing/test-get-async.html
+++ b/js/testing/test-get-async.html
@@ -10,7 +10,7 @@
<script type="text/javascript" src="../Helper.js"></script>
<script type="text/javascript">
- var ndn = new NDN();
+ var ndn = new NDN({port:9696});
ndn.transport.connectWebSocket(ndn);
var AsyncGetClosure = function AsyncGetClosure() {
diff --git a/wsproxy/wsproxy-tcp.js b/wsproxy/wsproxy-tcp.js
index 2e4c4b6..fe4f816 100644
--- a/wsproxy/wsproxy-tcp.js
+++ b/wsproxy/wsproxy-tcp.js
@@ -9,6 +9,7 @@
var opt = require('node-getopt').create([
['c' , 'ccnd=ARG', 'host name or ip of ccnd router'],
+ ['p' , 'port=ARG', 'port number on which the proxy will listen'],
['m' , 'maxclient=ARG', 'maximum number of concurrent client'],
['L' , 'LOG=ARG', 'level of log message display'],
['h' , 'help', 'display this help']
@@ -21,7 +22,11 @@
var ccndhost = opt.options.ccnd || 'localhost';
//console.log(ccndhost);
-var wss = new WebSocketServer({port:9696}); //TODO: Do we need to make WS server port number configurable?
+var wsport = opt.options.port || 9696;
+//console.log(wsport);
+
+var wss = new WebSocketServer({port:wsport, host:'0.0.0.0'}); // Set host to '0.0.0.0' so that we can accept connections from anywhere
+ // This host has nothing to do with ccndhost.
var MaxNumOfClients = opt.options.maxclient || 40;
//console.log(MaxNumOfClients);
diff --git a/wsproxy/wsproxy-udp.js b/wsproxy/wsproxy-udp.js
index 9b79ac2..b81e2bd 100644
--- a/wsproxy/wsproxy-udp.js
+++ b/wsproxy/wsproxy-udp.js
@@ -9,6 +9,7 @@
var opt = require('node-getopt').create([
['c' , 'ccnd=ARG', 'host name or ip of ccnd router'],
+ ['p' , 'port=ARG', 'port number on which the proxy will listen'],
['m' , 'maxclient=ARG', 'maximum number of concurrent client'],
['L' , 'LOG=ARG', 'level of log message display'],
['h' , 'help', 'display this help']
@@ -17,8 +18,10 @@
.parseSystem(); // parse command line
var ccndhost = opt.options.ccnd || 'localhost';
+var wsport = opt.options.port || 9696;
-var wss = new WebSocketServer({port:9696});
+var wss = new WebSocketServer({port:wsport, host:'0.0.0.0'}); // Set host to '0.0.0.0' so that we can accept connections from anywhere
+ // This host has nothing to do with ccndhost.
var MaxNumOfClients = opt.options.maxclient || 40;