Skip to content

Commit

Permalink
don't get IP address in server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Nov 22, 2014
1 parent 23152d0 commit 9981790
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,6 @@ var iputils = require('../lib/iputils');
var Promise = require('promise');
var HFTServer = require('./hft-server');

if (!args.address) {
var addresses = iputils.getIpAddress();

if (addresses.length < 1) {
console.error("No IP address found for DNS");
}
args.address = addresses[0];
if (addresses.length > 1) {
console.log("more than 1 IP address found: " + addresses);
}
}
console.log("using ip address: " + args.address);

var server;
var launchBrowser = function(err) {
var next = function() {
Expand Down Expand Up @@ -153,7 +140,10 @@ var launchBrowser = function(err) {
server = new HFTServer(args, launchBrowser);

if (args.dns) {
var dnsServer = new DNSServer({address: args.address});
// This doesn't need to dynamicallly check for a change in ip address
// because it should only be used in a static ip address sitaution
// since DNS has to be static for our use-case.
var dnsServer = new DNSServer({address: args.address || iputils.getOneIpAddress()});
server.on('ports', function(ports) {
if (ports.indexOf("80") < 0 && ports.indexOf(80) < 0) {
console.error("You specified --dns but happyFunTimes could not use port 80.");
Expand Down

0 comments on commit 9981790

Please sign in to comment.