my HTTPS Proxy Server doesn't work! #181

Closed
pedramp opened this Issue Jan 25, 2012 · 12 comments

Projects

None yet

4 participants

@pedramp
pedramp commented Jan 25, 2012

Hi,
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 https://google.com)

thanks

@coderarity
Contributor

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
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://google.com" it works because of that "-k"
-k means: "-k/--insecure Allow connections to SSL sites without certs (H)"
thanks

@coderarity
Contributor

Can you show me your code? Thanks.

@pedramp
pedramp commented Apr 1, 2012

this is my code: https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/proxy-https-to-https.js

  1. run it
  2. setting SSL Proxy in your FireFox (127.0.0.1:8080) OR Secure Web Proxy HTTPS in Safari.
  3. opening the http://yahoo.com (works)
  4. opening httpS://google.com ( doesn't work ) please attention to that S.
@coderarity
Contributor

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

@coderarity
Contributor

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
pedramp commented Apr 2, 2012

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

@coderarity
Contributor

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

@coderarity
Contributor

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);
}).listen(8080);

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 "github.com" 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
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
@zkhalapyan

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

@pedramp
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