Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Add proxy as an alternative to Browser extension #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cacoos
Copy link

@cacoos cacoos commented Apr 2, 2024

I've been working with reverse proxies the last week and I think it would be useful to implement one here.

Via NGINX + OpenResty we can:

  • Modify the headers of the page (enabling inline scripts, or allowing to put it in an iframe, and much more that maybe can't be done with a simple browser extension)
  • Inject the dom3d.js script via body_filter_by_lua_file
  • Make the browser believe the page domain is actually the requested
  • Deploy somewhere and make these amazing 3D websites public :)

This PR also includes a Dockerfile to easily run it, and a fly.toml as an example on how to deploy it.

I've deployed one. Here are a few examples:

https://dom3d.fly.dev/p?uri=https://www.cacoos.com/
https://dom3d.fly.dev/p?uri=google.com

This is just a POC. If you think it could be useful, would love to add more docs.

Here you can setup locally:

  • Build: docker build -t nginx-proxy -f proxy/Dockerfile . (we need it to be from main directory so we have access to the dom3d.js file)
  • Run: docker run -p 9000:80 -it nginx-proxy (port 80 mapped to 9000)
  • Go to localhost:9000/p?uri=example.com

If you want to deploy, install the flyctl CLI and use fly launch --dockerfile proxy/Dockerfile

Screenshots:

https://dom3d.fly.dev/p?uri=google.com
Screenshot 2024-04-02 at 11 59 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant