my HTTPS Proxy Server doesn't work! #181

pedramp opened this Issue Jan 25, 2012 · 12 comments


None yet

4 participants

pedramp commented Jan 25, 2012

I have simple problem with https proxy server!
I make simple https proxy server (example files) and set my ip/port as proxy server in my browsers (HTTPS proxy server in Safari & SSL proxy in Firefox) but I could not receive any request when I try to open a secure website. I don't have problem with http servers and I can't handle incoming requests but in HTTP(S) websites, it doesn't work for me!

simple flow is:

  1. running https server on localhost:9000
  2. setting http & https proxy in browser
  3. no log in https server! when I want open a secure website in browser (like



set my ip/port as proxy server in my browsers (HTTPS proxy server in Safari & SSL proxy in Firefox)

Are you sure that node-http-proxy is the type of proxy you're looking for?

pedramp commented Mar 30, 2012

yes I'm sure that "proxy-https-to-https.js" (attention to "s") is the type of proxy I'm looking for. however I described above that I'm looking for "httpS" proxy,
after that, when I test it by "curl -k httpS://" it works because of that "-k"
-k means: "-k/--insecure Allow connections to SSL sites without certs (H)"


Can you show me your code? Thanks.

pedramp commented Apr 1, 2012

this is my code:

  1. run it
  2. setting SSL Proxy in your FireFox ( OR Secure Web Proxy HTTPS in Safari.
  3. opening the (works)
  4. opening httpS:// ( doesn't work ) please attention to that S.

Right. Well, node-http-proxy isn't normally used this way, but let me try to build you a better example to try!


Yeah, the reason the HTTP ones work fine is because it doesn't use the proxy for HTTP requests unless you set it up to do so.

pedramp commented Apr 2, 2012

and any solution? to making a proxy server, compatible with browsers and standard protocols (like http & https & more!)


Yeah, I'll make an example and link to it, so when I finish it you should see it show up here.


I started writing an example - I would imagine it should look like this.

var https = require('https'),
    util = require('util'),
    colors = require('colors'),
    httpProxy = require('../node-http-proxy/lib/node-http-proxy'),
    helpers = require('../node-http-proxy/test/helpers');

var opts = helpers.loadHttps();

// Create the proxy server listening on port 8080
https.createServer(opts, function (req, res) {
  var proxy = new httpProxy.HttpProxy({
    target: {
      https: true,
      host: req.headers['host'],
      port: 443
  proxy.proxyRequest(req, res);

util.puts('https proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8080'.yellow);

But for some reason, using "Secure Web Proxy (HTTPS)" isn't connecting to the server correctly. (Using a normal HTTP proxy is just fine) I tried setting the proxy to something else, like "" on port 443, but that didn't work either. I can't find any documentation on this feature of OS X. Unless you have something that can help me, I'm not sure I know how to make this example work.

NOTE: This works fine with curling to the server, but curl bypasses the proxy for some reason.

pedramp commented Apr 4, 2012

seems we're in starting point and you know what was my problem right now.
anyway thanks for your pursuit.

@indexzero indexzero closed this Mar 9, 2013

@pedramp Hey, did you get something working? Trying to do something similar.

pedramp commented Jun 6, 2013

@zkhalapyan nothing! I had problem in secure websites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment