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

Convert proxy to Cloudflare Pages Function. #840

Open
wants to merge 2 commits into
base: 11ty
Choose a base branch
from
Open

Conversation

davidlehn
Copy link
Member

  • Development of the proxy is a bit awkward. Need to run two servers and let the Eleventy dev server proxy to the real proxy on a wrangler dev server. Only needed if testing the http: support locally. The people doing that will probably rarely be more than me.
  • The Eleventy proxy bits require a newer feature in the Eleventy 3.x dev server. The rest of the site seems to build with that.
  • Suggestions welcome for hardening the proxy to be not useful outside of the playground.

- Remove PHP proxy code.
- Move proxy URL to /playground/proxy.
- Use eleventy@3 alpha for `onRequset` dev server support.
- Add Eleventy dev server `onRequest` proxy to local wrangler server
  proxy. Due to current limited API, emulate a basic playground request.
- Reimplement proxy as a Cloudflare Pages Function.
  - Basic proxy designed for limited use and abuse.
  - Add various checks to limit useful scope.
- Update README.
- Ignore .wrangler.
@davidlehn davidlehn requested a review from BigBlueHat May 1, 2024 02:00
Copy link
Member

@BigBlueHat BigBlueHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One code order tweak, and a couple questions. Thanks for continuing to push this forward!

};

// proxy to worker proxy
async function playgroundProxy({url}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be defined above its use on line 61?

README.md Show resolved Hide resolved
functions/playground/proxy.js Show resolved Hide resolved
@BigBlueHat BigBlueHat mentioned this pull request Sep 24, 2024
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.

2 participants