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

return fetch body directly #92

Merged
merged 2 commits into from
Jan 24, 2024
Merged

return fetch body directly #92

merged 2 commits into from
Jan 24, 2024

Conversation

syumai
Copy link
Owner

@syumai syumai commented Jan 24, 2024

What

  • add jsutil.RawJSWriter and use it in jshttp.ResponseWriter.
    • This passes raw JS fetch response body as Cloudflare Worker's response body without using Go's io.Reader.

Motivation

How to use this feature?

  • Please use the cloudflare/fetch package and io.Copy to implement the proxy.
  • See _examples/basic-auth-proxy/main.go.

@syumai syumai self-assigned this Jan 24, 2024
@syumai syumai merged commit 4b950e8 into main Jan 24, 2024
1 check passed
@syumai syumai deleted the return-fetch-body-directly branch January 24, 2024 15:07
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.

None yet

1 participant