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

add a proxy usage #358

Open
AlanGuo opened this issue Aug 3, 2021 · 0 comments
Open

add a proxy usage #358

AlanGuo opened this issue Aug 3, 2021 · 0 comments

Comments

@AlanGuo
Copy link

AlanGuo commented Aug 3, 2021

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/oauth/lib/oauth.js b/node_modules/oauth/lib/oauth.js
index 50dccf9..819e689 100644
--- a/node_modules/oauth/lib/oauth.js
+++ b/node_modules/oauth/lib/oauth.js
@@ -247,6 +247,12 @@ exports.OAuth.prototype._createClient= function( port, hostname, method, path, h
     method: method,
     headers: headers
   };
+  //  for proxy for local 
+  const HttpsProxyAgent = require('https-proxy-agent');
+  const proxy = process.env.http_proxy;
+  const agent = new HttpsProxyAgent(proxy);
+  options.agent = agent;
+
   var httpModel;
   if( sslEnabled ) {
     httpModel= https;

This issue body was partially generated by patch-package.

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

1 participant