wc-api-ruby
wc-api-ruby copied to clipboard
How could I use proxy to call an APIs
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.
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"
}
}
)
@raoulalwani thanks buddy!