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

feat: add agent options #643

Merged
merged 12 commits into from Jan 13, 2024
Merged

feat: add agent options #643

merged 12 commits into from Jan 13, 2024

Conversation

Youkehai
Copy link
Contributor

@Youkehai Youkehai commented Jan 5, 2024

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.

@lpinca
Copy link
Collaborator

lpinca commented Jan 6, 2024

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.

@Youkehai
Copy link
Contributor Author

Youkehai commented Jan 8, 2024

Sorry, I modified my method

@Youkehai Youkehai changed the title feat: add proxy by tunnel feat: add agent options Jan 8, 2024
README.md Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
types/index.test-d.ts Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
Youkehai and others added 10 commits January 11, 2024 09:04
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 814a74a on Youkehai:master
into a75493b on MONEI:master.

@lpinca lpinca merged commit 4f02cc9 into MONEI:master Jan 13, 2024
7 checks passed
@lpinca
Copy link
Collaborator

lpinca commented Jan 13, 2024

Thank you.

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

Successfully merging this pull request may close these issues.

None yet

4 participants