{"action":"created","issue":{"url":"https://api.github.com/repos/woothemes/wc-api-node/issues/15","repository_url":"https://api.github.com/repos/woothemes/wc-api-node","labels_url":"https://api.github.com/repos/woothemes/wc-api-node/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/wc-api-node/issues/15/comments","events_url":"https://api.github.com/repos/woothemes/wc-api-node/issues/15/events","html_url":"https://github.com/woothemes/wc-api-node/pull/15","id":141791286,"number":15,"title":"Oauth signatures with a proxy","user":{"login":"matthiasbe","id":9254232,"avatar_url":"https://avatars.githubusercontent.com/u/9254232?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbe","html_url":"https://github.com/matthiasbe","followers_url":"https://api.github.com/users/matthiasbe/followers","following_url":"https://api.github.com/users/matthiasbe/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbe/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbe/subscriptions","organizations_url":"https://api.github.com/users/matthiasbe/orgs","repos_url":"https://api.github.com/users/matthiasbe/repos","events_url":"https://api.github.com/users/matthiasbe/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-18T07:06:52Z","updated_at":"2016-03-18T07:16:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/woothemes/wc-api-node/pulls/15","html_url":"https://github.com/woothemes/wc-api-node/pull/15","diff_url":"https://github.com/woothemes/wc-api-node/pull/15.diff","patch_url":"https://github.com/woothemes/wc-api-node/pull/15.patch"},"body":"Adding the possibility to add a `proxy` in the options in the initialization of the API.\r\nThis is useful if you want to debug your Ionic app in the browser according to [this reference](http://ionicinaction.com/blog/how-to-fix-cors-issues-revisited/).\r\n\r\n**Example :**\r\n```javascript\r\nvar wc = new WooCommerceAPI({\r\n  consumerKey: 'ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\r\n  consumerSecret: 'cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',\r\n  url: 'http://localhost:8100/my-proxy/',\r\n  proxy: 'http://myactualsite.com/'\r\n});\r\n```\r\n\r\nWhat I did :\r\nI added a function `getProxyUrl` that returns the url of the endpoint according to the actual url of the website (variable `proxy` in API definition). This function is used instead of `getUrl` in case of a non-null `proxy` initialization when using Oauth to authenticate. This way, the actual address is used instead of the proxy to build the `oauth_signature` (that was my issue https://github.com/woothemes/wc-api-node/issues/14).\r\n\r\nHope it helps"},"comment":{"url":"https://api.github.com/repos/woothemes/wc-api-node/issues/comments/198235119","html_url":"https://github.com/woothemes/wc-api-node/pull/15#issuecomment-198235119","issue_url":"https://api.github.com/repos/woothemes/wc-api-node/issues/15","id":198235119,"user":{"login":"matthiasbe","id":9254232,"avatar_url":"https://avatars.githubusercontent.com/u/9254232?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbe","html_url":"https://github.com/matthiasbe","followers_url":"https://api.github.com/users/matthiasbe/followers","following_url":"https://api.github.com/users/matthiasbe/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbe/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbe/subscriptions","organizations_url":"https://api.github.com/users/matthiasbe/orgs","repos_url":"https://api.github.com/users/matthiasbe/repos","events_url":"https://api.github.com/users/matthiasbe/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbe/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T07:16:23Z","updated_at":"2016-03-18T07:16:23Z","body":"I might miss something but proxy is meant to be a `string` no ?\r\nBut I get your point I'm going for `null` as default."}}