Closed Youkehai closed 8 months ago
It would be better to only add an agent
option and forward the value to got
without adding a new dependency. This allows the user to use a different package. For example
const Shopify = require('shopify-api-node');
const { HttpsProxyAgent } = require('hpagent');
const agent = {
https: new HttpsProxyAgent({
keepAlive: true,
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: 'https://localhost:8080'
})
};
const shopify = new Shopify({
shopName: 'shop-name',
accessToken: 'token',
agent
});
Anyway, there are also packages like https://github.com/gajus/global-agent so I would prefer to not add the option.
Sorry, I modified my method
Thank you.
When your computer or server encounters network errors, timeouts, etc. while accessing Shopify, if you have a proxy server, you can set the proxy IP and port to resolve issues related to access timeouts and slowness.