Skip to content

Commit

Permalink
ip bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wuchangming committed Mar 21, 2016
1 parent 2e666aa commit 369b050
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/proxy/SpyProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ var debug = require('debug')('spy-debugger');
var config = require('../config/config');
var logColor = config.logColor;
var domain = require('domain');
var ip = require('ip');
var address = ip.address();

module.exports = function () {
function SpyProxy(options) {
Expand Down Expand Up @@ -46,7 +48,7 @@ module.exports = function () {
});
});
});
console.log(logColor.FgGreen + '%s' + logColor.Reset, '移动设备设置HTTP代理到本机。本机IP地址:' + os.networkInterfaces().en0[1].address + ',端口号为:' + port);
console.log(logColor.FgGreen + '%s' + logColor.Reset, '移动设备设置HTTP代理到本机。本机IP地址:' + address + ',端口号为:' + port);
}
}, {
key: 'requestHandler',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spy-debugger",
"version": "1.0.0",
"version": "1.0.1",
"description": "web page one-stop remote network debugger",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"dependencies": {
"commander": "^2.9.0",
"debug": "^2.2.0",
"ip": "^1.1.2",
"through2": "^2.0.1",
"weinre": "2.0.0-pre-I0Z7U9OV"
},
Expand Down
4 changes: 3 additions & 1 deletion src/proxy/SpyProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const debug = require('debug')('spy-debugger');
const config = require('../config/config');
const logColor = config.logColor;
const domain = require('domain');
const ip = require('ip');
var address = ip.address();

module.exports = class SpyProxy {
constructor(options) {
Expand All @@ -35,7 +37,7 @@ module.exports = class SpyProxy {
});
});
});
console.log(`${logColor.FgGreen}%s${logColor.Reset}`,`移动设备设置HTTP代理到本机。本机IP地址:${os.networkInterfaces().en0[1].address},端口号为:${port}`);
console.log(`${logColor.FgGreen}%s${logColor.Reset}`,`移动设备设置HTTP代理到本机。本机IP地址:${address},端口号为:${port}`);
}
requestHandler(req, res) {
var urlObject = url.parse(req.url);
Expand Down

0 comments on commit 369b050

Please sign in to comment.