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

How could I use proxy to call an APIs #60

Open
babarajay opened this issue Feb 12, 2024 · 2 comments
Open

How could I use proxy to call an APIs #60

babarajay opened this issue Feb 12, 2024 · 2 comments

Comments

@babarajay
Copy link

Description:
I have a condition where I wanted to use proxy to call woo commerce APIs. I went thru the open/closed issues but I could not get anything related to it so raising a new one.

Any help would be appreciated.

Thank you.

@raoulalwani
Copy link

If @babarajay or anyone else is looking for how to do this, you can pass in httparty_args as an option:

woocommerce = WooCommerce::API.new(
  "http://example.com",
  "ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  {
    wp_api: true,
    version: "wc/v3",
    httparty_args: {
      http_proxyaddr: "yourproxydomain.com",
      http_proxyport: 80, # or whatever your proxy port is
      http_proxyuser: "username",
      http_proxypass: "password"
    }
  }
)

@babarajay
Copy link
Author

@raoulalwani thanks buddy!

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

No branches or pull requests

2 participants