Skip to content

add a proxy usage #358

@AlanGuo

Description

@AlanGuo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions