localrelay icon indicating copy to clipboard operation
localrelay copied to clipboard

DNS redirector

Open Kamalaja opened this issue 1 year ago • 1 comments

Hey there! Wondering if you had a take on how to best resolve this!

First of all, thank you for making this! this is exactly what I was looking for to access my homelab away from home on my devices with zero fuss, whilst also failing over when locally. This is wonderful.

I spun up a quick test.

When I connect to propublica: http://p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/ via this system, clicking links will push me to a link like: "http://p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/article/formaldehyde-epa-trump-public-health-danger" rather than something like "127.0.0.1:8081/article/formaldehyde-epa-trump-public-health-danger".

Do you have a recommendation on how to best force apps (selfhosted, firefox, vanadium, etc...) to respect the local URL over the external?

Thanks

Kamalaja avatar Dec 04 '24 01:12 Kamalaja

Thank you! I'm happy that you find use in this project!

That issue is caused by the website returning absolute URLs in their HTML. The only way to remody that in localrelay would be to write a custom http intercepter, there is a example of this for editing http hesders, it is in the examples folder. This isn't ideal though and is prone to breakage.

Your best bet is solving this on the remote site (if it is your site) to not reference the full URL in links, just use paths e.g. href="/blogs/how-to.html". But I understand that may not be possible, so in that case using a browser extension to insert a js script which can use regex to update all the links on the current page, would be the simplest and least intrusive method.

Whilst this isn't a configuration I've tested nor officially endorse as a "in-scope feature", I'm happy to see what can be done to get this setup for you.

go-compile avatar Dec 05 '24 15:12 go-compile