diff --git a/README.md b/README.md index 0f5221d..0550d3a 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ Using https features #### to intercept(decrypt) https requests * start your anyproxy as normal. When rootCA is generated, it will intercept all the https requests for you automatically. -* if you get a warning like 'unsafe connection', please check if the root CA is trusted correctly. +* if you get a warning like 'unsafe connection', please check if the root CA is correctly trusted . #### to start an https proxy * ``anyproxy --type https --host my.domain.com`` diff --git a/lib/httpsServerMgr_test.js b/lib/httpsServerMgr_test.js deleted file mode 100644 index 09bc853..0000000 --- a/lib/httpsServerMgr_test.js +++ /dev/null @@ -1,8 +0,0 @@ -var httpsServerMgr = require("./httpsServerMgr"); - - -var instance = new httpsServerMgr(); - -instance.fetchPort("localhost",function(err,port){ - console.log(port); -}); \ No newline at end of file diff --git a/package.json b/package.json index 137f4bc..5b62aa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anyproxy", - "version": "2.4.4", + "version": "2.4.6", "description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.", "main": "proxy.js", "bin": { @@ -14,11 +14,12 @@ "entities": "^1.1.1", "express": "^4.8.5", "iconv-lite": "^0.4.4", + "ip": "^0.3.2", "juicer": "^0.6.6-stable", "nedb": "^0.11.0", - "ws": "^0.4.32", "socks5-http-client": "^0.1.6", - "socks5-https-client": "^0.2.2" + "socks5-https-client": "^0.2.2", + "ws": "^0.4.32" }, "devDependencies": {}, "scripts": { diff --git a/proxy.js b/proxy.js index 9fd6514..e38ca5d 100644 --- a/proxy.js +++ b/proxy.js @@ -25,6 +25,7 @@ var http = require('http'), juicer = require('juicer'), events = require("events"), express = require("express"), + ip = require("ip"), fork = require("child_process").fork; GLOBAL.recorder = new Recorder(); @@ -108,14 +109,15 @@ function proxyServer(option){ function(callback){ //web interface - var child_webServer = fork(path.join(__dirname,"./webServer.js"),[proxyWebPort, socketPort , proxyConfigPort,requestHandler.getRuleSummary()]); + var args = [proxyWebPort, socketPort, proxyConfigPort, requestHandler.getRuleSummary(), ip.address()]; + var child_webServer = fork(path.join(__dirname,"./webServer.js"),args); child_webServer.on("message",function(data){ if(data.type == "reqBody" && data.id){ child_webServer.send({ type : "body", id : data.id, body : GLOBAL.recorder.getBody(data.id) - }) + }); } }); @@ -243,7 +245,6 @@ function UIConfigServer(port){ inherits(UIConfigServer, events.EventEmitter); - module.exports.proxyServer = proxyServer; module.exports.generateRootCA = certMgr.generateRootCA; module.exports.isRootCAFileExists = certMgr.isRootCAFileExists; \ No newline at end of file diff --git a/web/index.html b/web/index.html index 49449d9..e6914f1 100644 --- a/web/index.html +++ b/web/index.html @@ -45,6 +45,7 @@ +