diff --git a/.gitignore b/.gitignore
index d0b035a..6ed0009 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
 .lock-wscript
 .svn
 .wafpickle-*
+tmp.txt
 CVS
 npm-debug.log
 cert/**/*.srl
diff --git a/bin.js b/bin.js
index a334744..1fbf2c8 100644
--- a/bin.js
+++ b/bin.js
@@ -16,4 +16,5 @@ if(program.clear){
 
 }else{
     mainProxy.startServer(program.type,program.port, program.host);
+    
 }
\ No newline at end of file
diff --git a/lib/requestHandler.js b/lib/requestHandler.js
index 2926980..c6c4e87 100644
--- a/lib/requestHandler.js
+++ b/lib/requestHandler.js
@@ -2,8 +2,9 @@ var http  = require("http"),
 	https = require("https");
 
 function handler(req,userRes){
+    console.log(req);
 
-    var ifHttps = !!req.connection.encrypted;
+    var ifHttps = !!req.connection.encrypted && !/http:/.test(req.url);
 
     var options = {
         hostname : req.headers.host,
diff --git a/package.json b/package.json
index fd29ecf..16ab03a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "anyproxy",
-  "version": "0.1.0",
+  "version": "0.1.1",
   "description": "https proxy over http",
   "main": "proxy.js",
   "bin": "bin.js",
diff --git a/proxy.js b/proxy.js
index e5c550b..e94a095 100644
--- a/proxy.js
+++ b/proxy.js
@@ -29,7 +29,7 @@ function startServer(type, port, hostname){
             //creat server
             function(callback){
                 if(proxyType == T_TYPE_HTTPS){
-                    httpsServerMgr.getCertificate(proxyHost,function(err,keyContent,crtContent){
+                    certMgr.getCertificate(proxyHost,function(err,keyContent,crtContent){
                         if(err){
                             callback(err);
                         }else{
@@ -44,6 +44,7 @@ function startServer(type, port, hostname){
                 }else{
                     httpProxyServer = http.createServer(requestHandler);
                     callback(null);
+                    
                 }        
             },