What you are trying to do may be related to https://github.com/nodejitsu/node-http-proxy/issues/197

If you set host and port in the target object, you can forward the request to this target but I don't know how to use node-http-proxy as an https forward proxy (with your browser or curl configured to use it).


Le 27/04/13 00:03, Jack O'Sullivan a écrit :
I am able to get the same result as you using curl https://localhost:443 or in a browser, but I'm wondering how can I put localhost:443 in as the HTTPS proxy in a browser. When I do that and try to connect to https://localhost, it just times out.

On Thursday, 25 April 2013 17:05:13 UTC+1, Jack O'Sullivan wrote:

    I would like to create a proxy for |HTTPS| connections with
    Node.js. I am using the |http-proxy|
    <https://github.com/nodejitsu/node-http-proxy> library, which
    works well. I can get a |HTTP| proxy to work perfectly, but when I
    try |HTTPS|, the request to the proxy just times out. Here is my
    code (a slightly modified version of the |node-http-proxy|
    |proxy-https-to-https|
    
<https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/proxy-https-to-https.js>
 example):

    |var  http=  require("http"),
         https=  require("https"),
         httpProxy=  require("http-proxy"),
         fs=  require('fs');

    var  httpsConfig=  {
       key:  fs.readFileSync('./jackos2500-key.pem'),
       cert:  fs.readFileSync('./jackos2500-cert.crt'),
    };

    https.createServer(httpsConfig,  function  (req,  res)  {
       res.writeHead(200,  {  'Content-Type':  'text/plain'  });
       res.write('hello https\n');
         res.end();
    }).listen(8000);

    httpProxy.createServer(8000,  'localhost',  {
       https:  httpsConfig,
       target:  {
         https:  true,
         rejectUnauthorized:  false
       }
    }).listen(443);|

    Is there something obvious I'm missing here or is there some other
    issue?

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.



--
Stéphane RIOS - +33 6 30 26 44 80 - @fasterize <http://twitter.com/stefounet> - skype:stephane_rios CEO fasterize.com <http://www.fasterize.com/?utm_source=sig&utm_medium=mail&utm_campaign=>
Make It Fast, Keep It Fast

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to