{"action":"created","issue":{"url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/21","labels_url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/21/comments","events_url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/21/events","html_url":"https://github.com/Rob--W/cors-anywhere/issues/21","id":56569407,"number":21,"title":"Cannot proxy without port and host, options.target or options.router, or proxy handlers","user":{"login":"oaksagelew","id":5853812,"avatar_url":"https://avatars.githubusercontent.com/u/5853812?v=3","gravatar_id":"","url":"https://api.github.com/users/oaksagelew","html_url":"https://github.com/oaksagelew","followers_url":"https://api.github.com/users/oaksagelew/followers","following_url":"https://api.github.com/users/oaksagelew/following{/other_user}","gists_url":"https://api.github.com/users/oaksagelew/gists{/gist_id}","starred_url":"https://api.github.com/users/oaksagelew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaksagelew/subscriptions","organizations_url":"https://api.github.com/users/oaksagelew/orgs","repos_url":"https://api.github.com/users/oaksagelew/repos","events_url":"https://api.github.com/users/oaksagelew/events{/privacy}","received_events_url":"https://api.github.com/users/oaksagelew/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-04T18:46:04Z","updated_at":"2015-02-08T16:58:10Z","closed_at":"2015-02-04T22:25:54Z","body":"I'm trying to use this and am encountering an error:\r\nI'm hosting this on Modulus.io, and have set up the Package.json to have `start: node server.js`, with `main` also set to `server.js`. `server.js` is exactly like the file in the repo, except for `HOST`, which is set by Modulus.\r\n\r\nAny idea what I'm doing wrong? I can't even get to the point of calling the `doCORSRequest` from the HTML because I can't get the server-side to start. Any help appreciated!\r\n\r\n\r\n`/mnt/data/1/node_modules/http-proxy/lib/node-http-proxy.js:122\r\n    throw new Error(message);`\r\n          ^\r\n**Error: Cannot proxy without port and host, options.target or options.router, or proxy handlers**\r\n`    at Object.exports.createServer (/mnt/data/1/node_modules/http-proxy/lib/node-http-proxy.js:122:11)`\r\n`    at Object.createServer (/mnt/data/1/cors-anywhere.js:325:27)`\r\n`    at Object.<anonymous> (/mnt/data/1/server.js:7:12)`\r\n`    at Module._compile (module.js:456:26)`\r\n`    at Object.Module._extensions..js (module.js:474:10)`\r\n`    at Module.load (module.js:356:32)`\r\n`    at Function.Module._load (module.js:312:12)`\r\n`    at Function.Module.runMain (module.js:497:10)`\r\n`    at startup (node.js:119:16)`\r\n`    at node.js:929:3`"},"comment":{"url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/comments/73419487","html_url":"https://github.com/Rob--W/cors-anywhere/issues/21#issuecomment-73419487","issue_url":"https://api.github.com/repos/Rob--W/cors-anywhere/issues/21","id":73419487,"user":{"login":"oaksagelew","id":5853812,"avatar_url":"https://avatars.githubusercontent.com/u/5853812?v=3","gravatar_id":"","url":"https://api.github.com/users/oaksagelew","html_url":"https://github.com/oaksagelew","followers_url":"https://api.github.com/users/oaksagelew/followers","following_url":"https://api.github.com/users/oaksagelew/following{/other_user}","gists_url":"https://api.github.com/users/oaksagelew/gists{/gist_id}","starred_url":"https://api.github.com/users/oaksagelew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaksagelew/subscriptions","organizations_url":"https://api.github.com/users/oaksagelew/orgs","repos_url":"https://api.github.com/users/oaksagelew/repos","events_url":"https://api.github.com/users/oaksagelew/events{/privacy}","received_events_url":"https://api.github.com/users/oaksagelew/received_events","type":"User","site_admin":false},"created_at":"2015-02-08T16:58:10Z","updated_at":"2015-02-08T16:58:10Z","body":"Yes, you are – again – quite right. My problem was that I was setting the “src” and not “srcdoc” property of the <iframe> when setting the returned contents of the XHR call, and that’s fixed and now sites are displaying fine.\n \nTwo additional questions, and I hope these will be the last and I won’t abuse the generosity with which you’ve helped me so far:\n \n1.       Why are we stripping out the “Cookie” header? And, what would happen if we didn’t strip this out? I’m thinking now again of the macys.com site, which you pointed out was trying to set Cookies and the request failed because the proxy removes that. I guess cookies don’t make sense in a proxied environment, but would anything really bad happen if we didn’t strip them out?\n2.       Some sites use relative paths to access resources such as images and scripts (e.g., a site like gap.com has “/assets/image1.png”, etc. instead of “http://gap.com/assets/image1.png”. How does the CORSAnywhere proxy deal with that? Will it retrieve these resources correctly? It doesn’t if it’s called with an XHR and the “srcdoc” property of the <iframe> is used to load the site content. Short of parsing any URL and injecting the full domain name, would there be any other workarounds for this?\n \nThanks again for all your help – really appreciate it!\n \nLew\n \nFrom: Rob Wu [mailto:notifications@github.com] \nSent: Sunday, February 08, 2015 10:29 AM\nTo: Rob--W/cors-anywhere\nCc: Lew Hollerbach\nSubject: Re: [cors-anywhere] Cannot proxy without port and host, options.target or options.router, or proxy handlers (#21)\n \nCORS Anywhere does not modify the response body in any way, so it's likely caused by an error in your code (or in one of the libraries that you use). Visit the demo at https://robwu.nl/cors-anywhere.html, try any URL and the response body looks all right.\n—\nReply to this email directly or view <https://github.com/Rob--W/cors-anywhere/issues/21#issuecomment-73415536>  it on GitHub.  <https://github.com/notifications/beacon/AFlSdM3CJsH9frjRSLdHVU7q2WmNgE9cks5np3hGgaJpZM4DbwV4.gif> \n"}}