From af298855ec4ebcb0593a476145ac30205cd6a5bb Mon Sep 17 00:00:00 2001 From: Michael Lill Date: Wed, 27 Jan 2016 12:19:26 +0100 Subject: [PATCH] OpenShift IP-Fix for example/http.js --- examples/http.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/http.js b/examples/http.js index a873e1c4..09524cec 100644 --- a/examples/http.js +++ b/examples/http.js @@ -1,4 +1,5 @@ var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 80; +var ip = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'; var Gun = require('gun'); var gun = Gun({ @@ -20,6 +21,7 @@ var server = require('http').createServer(function(req, res){ }).pipe(res); // stream }); gun.wsp(server); -server.listen(port); +server.listen(port, ip); + +console.log('Server started on port ' + port + ' with /gun'); -console.log('Server started on port ' + port + ' with /gun'); \ No newline at end of file