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

Integration with Worker Sites #27

Open
1 of 4 tasks
jorgelbg opened this issue Feb 8, 2021 · 0 comments
Open
1 of 4 tasks

Integration with Worker Sites #27

jorgelbg opened this issue Feb 8, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jorgelbg
Copy link
Owner

jorgelbg commented Feb 8, 2021

Since a request can go through a single Cloudflare worker, it is not possible to run dashflare transparently. This is becoming more important after the release of Worker Sites that allow running a full website from the worker.

For this case, #7 introduced the possibility of forwarding the URL directly to the worker. This PR makes the worker stop behaving as a transparent proxy and just analyze the URL received via the x-original-url header.

Still pending:

  • Document how to set up dashflare with a Worker Site
  • Maybe publish a small npm module to do the forwarding
  • Allow the possibility of forwarding also a status code, now it is hardcoded to 200
  • Forwarding of the origin fetch time

See https://github.com/mre/endler.dev/blob/master/workers-site/index.js#L66-L73, is the only working example of this setup.

@jorgelbg jorgelbg added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 8, 2021
jorgelbg added a commit that referenced this issue Feb 15, 2021
For supporting worker sites we hardcoded the status code to 200 since we
don't have access to the status code of the original request. This
allows to forward a custom status code via `x-original-status-code`
header.

Relates to #27.

Signed-off-by: Jorge Luis Betancourt Gonzalez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant