load script files and design from a relative path
See original GitHub issueHello, 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:
- Created a year ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Pinned issue is 301, the one at the top of the issue list on Github.
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