Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a simple command line client that would be invoked something like this:

http2https --listen localhost:80 --connect

which would then allow me to effectively connect to by actually connecting to http://localhost? It would need to work on Windows.

I have tried stunnel, but it doesn't seem to work.


Here's the output of stunnel.exe -c -r -d

No limit detected for the number of clients
stunnel 4.56 on x86-pc-msvc-1500 platform
Compiled/running with OpenSSL 1.0.1e-fips 11 Feb 2013
Reading configuration from file -c
Cannot read configuration

stunnel [ [-install | -uninstall] [-quiet] [<filename>] ] | -help | -version | -sockets
    <filename>  - use specified config file
    -install    - install NT service
    -uninstall  - uninstall NT service
    -quiet      - don't display a message box on success
    -help       - get config file help
    -version    - display version and defaults
    -sockets    - display default socket options

Server is down
share|improve this question

stunnel is what you are after:

sudo stunnel -c -r -d

This sets up a SSL session to the remote party (Google in this case), and creates a listener on localhost port 8888. You can use 80 if you don't already have a listener.

Then you access localhost:8888 and you'll get the remote site.

If you are using Windows, then command line options aren't supported, so create a file stunnel.conf with the parameters within:

accept = 8888
connect =

Then call it with

stunnel -c stunnel.conf
share|improve this answer
Thanks, but it didn't work. The output has been added to the question. – Steve Taylor Apr 13 '13 at 6:32
Yes, Windows. See the post. When I'm back on my Windows machine, I'll publish a small nodejs app I wrote for this purpose. – Steve Taylor Apr 16 '13 at 13:26
What is there to try? You just added the windows tag. Thanks for that anyway. – Steve Taylor Apr 17 '13 at 12:27
Sorry - I meant the updated answer. – Paul Apr 17 '13 at 13:09
I'm getting the feeling there are two distinct versions of stunnel with completely different parameters. Check the output of stunnel in the question that shows the parameters that are available to be set. Nowhere is the a -c parameter. In fact, it says it's looking for a configuration file called -c because I put the -c option on the command line and it did not recognize it as an option. – Steve Taylor Apr 17 '13 at 13:13

Here's a node.js script that does what I want:

var http = require('http');
var https = require('https');

http.createServer(function (req, resp) {
    var h = req.headers; = "";
    var req2 = https.request({ host:, port: 443, path: req.url, method: req.method, headers: h }, function (resp2) {
        resp.writeHead(resp2.statusCode, resp2.headers);
        resp2.on('data', function (d) { resp.write(d); });
        resp2.on('end', function () { resp.end(); });
    req.on('data', function (d) { req2.write(d); });
    req.on('end', function () { req2.end(); });
}).listen(9999, "");
console.log('Server running at');

The host and local port are both hardcoded, but it would be easy enough to make them command line parameters.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .