HTTPS over HTTP Proxy?

232 views
Skip to first unread message

Hagen

unread,
Oct 22, 2010, 9:49:16 AM10/22/10
to nod...@googlegroups.com
Hi all,


is there a documented way of doing this?

From what I understand, I need to do a 

http.createClient("myproxy", 8080).request("CONNECT", "https://mytarget", {Upgrade: "TLS/1.0"})

Anybody tried this and can provide me example code how to switch to TLS afterwards? How do I differentiate between the header the proxy sees and the crypted header the HTTPS target sees?

Thanks,
Hagen

Danny Brain

unread,
Nov 8, 2010, 9:23:44 PM11/8/10
to nodejs
Also looking for a solution to this. Wrapping the node process in
proxychains works, but would prefer it to be handled internally.

Danny Brain

unread,
Nov 8, 2010, 11:45:34 PM11/8/10
to nodejs
Also interested in this, I've temporarily worked around the issue with
proxychains but not the solution I'm looking for.

On Oct 23, 12:49 am, Hagen <six...@gmail.com> wrote:

Ben Noordhuis

unread,
Nov 9, 2010, 5:28:37 AM11/9/10
to nod...@googlegroups.com

CONNECT works like this:

1. You connect to the proxy
2. The proxy opens a TCP stream to the target server
3. The proxy dumbly forwards all traffic between you and the target

I don't think you can get CONNECT to reliably work with Node's HTTP
library. The HTTP parser expects well-formed messages but after step 1
the stream is no longer true HTTP, just arbitrary data being proxied
between two peers.

Danny Brain

unread,
Nov 9, 2010, 8:33:47 PM11/9/10
to nod...@googlegroups.com
Thanks Ben. Any suggestions on how to implement this? Or seen any examples of this kind of thing being done with node?
Sorry for the double post above, I was using the google groups web interface and the messages didn't show up, so thought they didn't go through.


--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.


Reply all
Reply to author
Forward
0 new messages