swagger-js icon indicating copy to clipboard operation
swagger-js copied to clipboard

I want HTTP request go through a HTTP proxy in the nodejs

Open songtanjichuan opened this issue 1 year ago • 1 comments

e: const SwaggerClient = require('swagger-client'); const HttpsProxyAgent = require('https-proxy-agent');

const proxyUrl = 'http://your-proxy-url:port'; const agent = new HttpsProxyAgent(proxyUrl);

const request = { url: 'https://httpbin.org/', method: 'GET', requestInterceptor: req => { req.agent = agent; // 设置代理 return req; }, }; The above example is incorrect. I am new in this area,Thanks for your help.

songtanjichuan avatar Oct 08 '24 09:10 songtanjichuan