swagger-js
swagger-js copied to clipboard
I want HTTP request go through a HTTP proxy in the nodejs
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.