New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How To: toProxy with HTTPS requests? #848
Comments
You need to tell Express is just a wrapper to node's connect module, so I'm sure you can extrapolate what you need. |
So, from what I understand, I have to create both a http and https servers to make this happen and pass to them the connections selectively? Humm, I'm starting to think this particular project isn't suitable for NodeJS and my MEAN Boilerplate... I'm going to do it with Volt (the new isomorphic ruby framework) as I'll be needing other features this particular framework has built-in and the proxying part it's way easier with some ruby gems available. Thanks! |
You make this sound like a chore. It's like 2-3 more lines of code. I mean, I guess you can serve both http and https requests from the same port - I've never done it. Either way you need to tell this module about your certificates, which is trivial. |
It's not only that, it's just a lot of things for this project I'm working on "feel" like have to be built from scratch if I use NodeJS (My MEAN Stack boilerplate as always); For example the proxying part is just a little portion of the issues, there's a gem (em-proxy) that does the transparent proxying I need without me needing to mess around with certs or two different HTTP servers and selective requests. I'll be needing a websockets implementation with permissions enabled, I have code written for NodeJS with something similar working but it is not "modularized" to be part of a different app. Volt has a websockets implementation with permissions handled via the models built-in. Another thing that comes to mind is that I'd like to open source a piece of this project I'm building for handling the in-browser sessions that are created when 'stealth' users hit the app, but if I work with my usual stack I might end up with such code tightly coupled in to the overall project so I'd need to extract it later to another whole new independent project making me work twice. In Volt (for what I've seen these couple of days); Everything in the app it's a "component" (everything it's modularized) and extracting a piece of the app into a gem for publishing it's very trivial (you just have to run one command and "poof" you've successfully built an independent ruby gem ready for publishing from a piece of your project); So there's that... TL;DR it's not the problems with this particular npm module itself, the whole project doesn't seem to fit with my regular stack and I have other things to build, so I'd rather do it quickly than go all "trial and error" on this one. |
For future reference, this is why this module was written For anyone else looking for ways to do websockets that could integrate with Cheers to all! |
In case others are trying to do something similar, just wanted to add some extra information since this was one of the top google search results and the answers here led me towards the wrong path. When setting up an http proxy on your browser i.e. A better explanation on this is in the node request module under Proxies: An example directly from the node documentation on creating a simple http proxy: This module does not really seem to support creating a "traditional" proxy (or at the very least there are no examples anywhere on how to do so) but is really geared for creating a reverse proxy which it is great at doing. The closest thing I found to a solution for this using this module for some of the work is the gist linked at #700 (comment) |
So, I have a proxy server running on my machine (privoxy); What I wanna do is redirect all the requests from a NodeJS custom proxy built with this library to that proxy. What I have done so far is this:
And it works as expected, if I "proxify" my browser via 127.0.0.1:5050 requests are handled by my privoxy proxy. The problem is, I only can do HTTP requests. If I try to visit a site via https:// then I get an empty response error in the browser, and nothing useful in the logs.
I would like to know 2 things:
Thanks!
The text was updated successfully, but these errors were encountered: