Skip to content
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

HTTPS proxy support #3

Open
debrouxl opened this issue Jun 8, 2015 · 3 comments
Open

HTTPS proxy support #3

debrouxl opened this issue Jun 8, 2015 · 3 comments

Comments

@debrouxl
Copy link

debrouxl commented Jun 8, 2015

For the poor guys and girls among us who have to deal with HTTPS proxies, a way to tell the ovh module that the .request method should attempt to access the OVH HTTPS API through a proxy would be great :)

AFAICT, the proper way to have HTTP/HTTPS requests go through a proxy is to pass an instance of https.Agent ( https://nodejs.org/api/https.html#https_class_https_agent ) as 'agent' property of the 'options' argument to https.request().
One of the ways to create such agents is https://www.npmjs.com/package/tunnel-agent , which has the same API as https://www.npmjs.com/package/tunnel .

I could attempt to contribute a patch by myself, but I'd rather discuss the direction with the maintainer up front. I can see at least three reasonable ways to pass the agent to an instance of the ovh module for .request() to use (.loadSchemasRequest() already takes options passed directly to https.get()):

  1. at initialization time, require('ovh')({ ...}) - less flexible IMO;
  2. at any point, through a setter which would apply to future invocations of the .request() method;
  3. at request time, through a new argument to e.g. ovh.request();
    and at least a dirty way: pass the agent through a specially-named property of the 'params' argument to ovh.request(), which is probably what I'll attempt to use for my own purposes, as a temporary measure.
    Your preference may not match mine, and might not even be listed here :)
@jbblanchet
Copy link

Hi. Sorry for the delay.

I'm willing to consider a pull request for such a change. I think this custom agent should be settable both through the constructor or a setCustomAgent method (which could accept undefined or null to remove the agent). Let me know if you want to discuss this further.

Thanks.

@debrouxl
Copy link
Author

debrouxl commented Aug 7, 2015

Hi,

Alright, I'll integrate such changes into the code base in a couple weeks (I'm currently on holiday), test it and send a pull request.

debrouxl added a commit to debrouxl/node-ovh that referenced this issue Aug 17, 2015
debrouxl added a commit to debrouxl/node-ovh that referenced this issue Aug 17, 2015
debrouxl added a commit to debrouxl/node-ovh that referenced this issue Aug 17, 2015
debrouxl added a commit to debrouxl/node-ovh that referenced this issue Aug 24, 2015
debrouxl added a commit to debrouxl/node-ovh that referenced this issue Aug 24, 2015
@loganmzz
Copy link

Stil no support for proxy settings ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants