{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs-templates/webpack/issues/456","repository_url":"https://api.github.com/repos/vuejs-templates/webpack","labels_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/456/labels{/name}","comments_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/456/comments","events_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/456/events","html_url":"https://github.com/vuejs-templates/webpack/issues/456","id":202320812,"number":456,"title":"CORS hassle free proxy","user":{"login":"woozyking","id":2837532,"avatar_url":"https://avatars.githubusercontent.com/u/2837532?v=3","gravatar_id":"","url":"https://api.github.com/users/woozyking","html_url":"https://github.com/woozyking","followers_url":"https://api.github.com/users/woozyking/followers","following_url":"https://api.github.com/users/woozyking/following{/other_user}","gists_url":"https://api.github.com/users/woozyking/gists{/gist_id}","starred_url":"https://api.github.com/users/woozyking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woozyking/subscriptions","organizations_url":"https://api.github.com/users/woozyking/orgs","repos_url":"https://api.github.com/users/woozyking/repos","events_url":"https://api.github.com/users/woozyking/events{/privacy}","received_events_url":"https://api.github.com/users/woozyking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-01-21T15:12:11Z","updated_at":"2017-01-31T16:32:38Z","closed_at":null,"body":"If I'm missing something and/or wrong about this, please correct me, thanks!\r\n\r\nI find the implementation using https://github.com/chimurai/http-proxy-middleware is convenient, except that it's not always so simple when facing `Access-Control` header restrictions, which often requires the API/Data/Backend server to configure CORS.\r\n\r\nOne sure way I can think of is to use an HTTP client library such as https://github.com/mzabriskie/axios or https://github.com/request/request to make the request through server side (which to my understanding isn't restricted by the cross-origin settings anymore) and pipe the retrieved response to the client, like `req.pipe(request({...API_OPTIONS...})).pipe(res)` for the simplest example inside the API tunneling/proxy middleware.\r\n\r\nAgain, maybe I'm missing something very obvious and dead simple to achieve the same through `http-proxy-middleware`, in which case please point out."},"comment":{"url":"https://api.github.com/repos/vuejs-templates/webpack/issues/comments/276415019","html_url":"https://github.com/vuejs-templates/webpack/issues/456#issuecomment-276415019","issue_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/456","id":276415019,"user":{"login":"asvae","id":5394573,"avatar_url":"https://avatars.githubusercontent.com/u/5394573?v=3","gravatar_id":"","url":"https://api.github.com/users/asvae","html_url":"https://github.com/asvae","followers_url":"https://api.github.com/users/asvae/followers","following_url":"https://api.github.com/users/asvae/following{/other_user}","gists_url":"https://api.github.com/users/asvae/gists{/gist_id}","starred_url":"https://api.github.com/users/asvae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvae/subscriptions","organizations_url":"https://api.github.com/users/asvae/orgs","repos_url":"https://api.github.com/users/asvae/repos","events_url":"https://api.github.com/users/asvae/events{/privacy}","received_events_url":"https://api.github.com/users/asvae/received_events","type":"User","site_admin":false},"created_at":"2017-01-31T16:32:38Z","updated_at":"2017-01-31T16:32:38Z","body":"@woozyking could it be you're using absolute urls for you ajax?\r\n\r\nThey should look like this:\r\n```\r\n/api/user/create\r\n```\r\nAnd not like this\r\n```\r\nhttp://project.local/api/user/create\r\n```\r\nBecause proxy proxies only requests to `localhost`."}}
{"actor":{"display_login":"asvae"}}