question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

load script files and design from a relative path

See original GitHub issue

Hello, I host this great proxy myself, and approach it like this: https://myproxy.com/https://domain.com But when the destination site - domain.com - loads design / script files from a relative path, i.e. “/script”, the file is not loaded and the site display goes wrong … I checked the Networks tab in Chrome’s development tool, and I see that it’s trying to load the file from the path https://myproxy.com/script.js, instead of https://myproxy.com/https://domain.com/script.js. I would be happy if you take care of the problem 😃 Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Rob--Wcommented, Apr 17, 2022

Duplicate of https://github.com/Rob--W/cors-anywhere/issues/61#issuecomment-277641055

Basically, CORS Anywhere is not supposed to be used as a generic proxy. It should only be used to fetch single resources.

0reactions
Rob--Wcommented, Apr 17, 2022

Pinned issue is 301, the one at the top of the issue list on Github.

This is one particular site that I want to load as html via proxy … not the whole network 😃

Even if it is one site, it is not recommended to insert HTML from a third party in your own website.

If it is for personal use only, I suggest to use a browser extension to allow the site to be embedded in your website. If you want it to work without browser extensions, you could try to create a new subdomain, and proxy everything at that subdomain to a different destination. As it sounds like you don’t need the CORS aspect of this project, but more the proxying functionality, you could use a different library to proxy requests, e.g. the http-proxy library with this example https://github.com/http-party/node-http-proxy#setup-a-basic-stand-alone-proxy-server

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Src Path - Stack Overflow
Use an relative path to the root of your site, for example: ... you have to put the JavaScript file in a directory...
Read more >
Relative paths - Qlik Community - 1699097
When creating a load script, you often use data from files, e.g. xls, csv, txt, or qvd. By default, absolute paths to the...
Read more >
Relative paths for scripts - ADM Help Centers
Relative paths for scripts. You can specify a relative location for a script in your scenario. The location can be relative to the...
Read more >
HTML File Paths - W3Schools
A file path describes the location of a file in a web site's folder structure. File paths are used when linking to external...
Read more >
Understanding HTML File Paths & How to Use Them
Learn about the differences between absolute and relative HTML file paths and how you can use them to improve your web development skills....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found