caddyserver / forwardproxy

Forward proxy plugin for the Caddy web server
Apache License 2.0
603 stars 228 forks source link

Buffer http response instead of writing directly #106

Closed Mygod closed 1 year ago

Mygod commented 1 year ago

1. What does this change do, exactly?

Currently when handling HTTP 1.1 CONNECT method, multiple packets are sent just to write the HTTP response header. This PR changes that. (Verified through tcpdump.)

2. Please link to the relevant issues.

N/A

3. Which documentation changes (if any) need to be made because of this PR?

N/A

4. Checklist

mholt commented 1 year ago

Thanks; but streaming the response is a feature. Why is the current implementation problematic?

Mygod commented 1 year ago

Sorry for the confusion. This buffer applies to the header generated by caddy plugin only but not later.