I see. I thought maybe of serving the remote server files from my node server. Do you know maybe a way to download the remote website to a local directory on the node server and I'll edit the html so that my css and js files will be relative to where the website directory is stored? Also if I do such thing, and serving the files from my node server, I would also need to deal with CORS. Do you know of a way I can intercept the any http OPTION request that is done by the browser and change the origin header to set it to the remote server?
בתאריך יום שישי, 18 בדצמבר 2015 בשעה 19:02:37 UTC+2, מאת Jimb Esser: > > I don't know anything about jsdom, but from what you said it sounds like > you're trying to set up a server, to which you can request > http://myhost/?url=otherhost.com/page.html and it returns that page, and > then when that pages fetches style.css, it's failing. You need to rewrite > what is returned so that on the very first request instead of letting > otherhost.com/page.html reference "style.css", it instead references a > valid URL that will get what it needs, e.g. a mapped url that goes through > your server: http://myhost/?url=otherhost.com/style.css (or, probably > just "/?url=otherhost.com/style.css"). I have no idea how you'd do that > with jsdom, but it probably involves changing all hrefs to relative paths > to be prefixed with "/?url=otherhost.com/" or something. Without > remapping those paths, it's trying to fetch the stylesheet from your > server, not forwarding the request on appropriately. > > Hope this helps! > Jimb Esser > > On Wednesday, December 16, 2015 at 5:10:56 PM UTC-8, Roy Mor wrote: >> >> Still struggling with this problem, looking for someone who could shed a >> light and help me u derstand. > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/24999672-4c17-4d4d-9fc8-61dd648dd306%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
