From b851d068a8ed4cfa4150b8ce7f57798a7ba54e9e Mon Sep 17 00:00:00 2001 From: Brad Metcalf Date: Fri, 3 Apr 2015 01:38:28 -0500 Subject: [PATCH] Changed host to DNS name instead of IP --- lib/bridge.js | 2 +- package.json | 2 +- php-webkit/main.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bridge.js b/lib/bridge.js index f9a764a..e0b079f 100644 --- a/lib/bridge.js +++ b/lib/bridge.js @@ -55,7 +55,7 @@ function runPHP(req, response, next, phpinfo){ ALL_RAW: Object.keys(req.headers).map(function(x){return x+": "+req.headers[x];}).reduce(function(a, b){return a+b+"\n";}, ""), //All HTTP headers as sent by the client in raw form. No transformation on the header names is applied. SERVER_SOFTWARE: "php-webkit", //The web server's software identity. SERVER_NAME: phpinfo.host, //The host name or the IP address of the computer running the web server as given in the requested URL. - SERVER_ADDR: phpinfo.host, //The IP address of the computer running the web server. + SERVER_ADDR: req.connection.localAddress || req.socket.localAddress || req.connection.socket.localAddress || "", //The IP address of the computer running the web server. SERVER_PORT: (phpinfo.port == 0 ? req.connection.localPort : phpinfo.port), //The port to which the request was sent. GATEWAY_INTERFACE: "CGI/1.1", //The CGI Specification version supported by the web server; always set to CGI/1.1. SERVER_PROTOCOL: "", //The HTTP protocol version used by the current request. diff --git a/package.json b/package.json index 655ab59..802c188 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "phpwebkit": { "bin": "", "path": "./application", - "host": "127.0.0.1", + "host": "localhost", "port": 9090 }, "license":"MIT", diff --git a/php-webkit/main.js b/php-webkit/main.js index 4c41d7e..04e5cf9 100644 --- a/php-webkit/main.js +++ b/php-webkit/main.js @@ -40,7 +40,7 @@ var phpwebkit = { var host = gui.App.manifest.phpwebkit.host; if(host === undefined || host == "") { - host = '127.0.0.1'; + host = 'localhost'; } var port = gui.App.manifest.phpwebkit.port;