]]]", program);
}
@@ -248,15 +328,10 @@ else {
// console.log("START");
var self = this;
- self.base = {
- hostname: ip,
- port: port,
- };
-
var remote = (new Remote({
websocket_ip: ws_ip,
websocket_port: ws_port,
-// trace: true
+ trace: false
}))
.on('state', function (m) {
console.log("STATE: %s", m);
@@ -267,6 +342,12 @@ else {
.connect()
;
+ self.base = {
+ hostname: ip,
+ port: port,
+ remote: remote,
+ };
+
// console.log("SERVE");
var server = http.createServer(function (req, res) {
var input = "";
@@ -294,14 +375,16 @@ else {
.on('success', function (m) {
// console.log("account_root: %s", JSON.stringify(m, undefined, 2));
- httpd_response(res,
- {
- statusCode: 200,
- url: _url,
- body: ""
- + JSON.stringify(rewrite_object(m, self.base), undefined, 2)
- + "
"
- });
+ augment_object(m, self.base, function() {
+ httpd_response(res,
+ {
+ statusCode: 200,
+ url: _url,
+ body: ""
+ + JSON.stringify(rewrite_object(m, self.base), undefined, 2)
+ + "
"
+ });
+ });
})
.request();