@shahruk/local-proxy-server
v1.0.5
Published
Download any page into a local HTML file and proxy all 404s to a different HTTP server. Useful for debugging and working on slow sites by treating them as static asset servers.
Downloads
5
Readme
@shahruk/local-proxy-server
Local Proxy Server lets you serve a page locally with a proxy server as fallback. The page gets downloaded to a local file and then served via a local HTTP server. Includes BYPASS_AKAMAI headers by default.
Usage
npx @shahruk/local-proxy-server URL_TO_SCRAPE SAVE_PATH PROXY_URL
Example: Save https://www.example.com/ as index.html and serve all missing files from https://example.com
npx @shahruk/local-proxy-server https://www.example.com/ index.html https://example.com
Authentication
Scrape a site behind basic auth using the authentication header.
npx @shahruk/local-proxy-server https://www.example.com/ --authentication="username:password" index.html https://example.com
What can I use this for?
- When working on JS and CSS files for a slow monolithic app, you can treat the monolith as a static site generator
- Download any website and edit it however you want locally
- Download a news page and edit it to make fake headlines
- Download the example homepage and insert your own custom feature
- Customize a template to see what it would look like with your own images
- Etc.
Additional Files
If for example example.com's logo was saved as /logo.jpg, you could add a file locally as logo.jpg and it would be served instead of the one hosted at https://example.com/logo.jpg