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

http3: response body not implemented http3.HTTPStreamer #4526

Closed
phuslu opened this issue May 19, 2024 · 9 comments
Closed

http3: response body not implemented http3.HTTPStreamer #4526

phuslu opened this issue May 19, 2024 · 9 comments

Comments

@phuslu
Copy link
Contributor

phuslu commented May 19, 2024

Seems that this is broken by #4469

It makes my http3 dialer not working

streamer, ok := resp.Body.(http3.HTTPStreamer)
if !ok {
    return nil, errors.New("proxy: read from " + d.Host + " error: resp body not implemented http3.HTTPStreamer")
}

Any suggestion?

@marten-seemann
Copy link
Member

This was called out as a breaking change in the release notes of v0.43. It is now the http.ResponseWriter that implements the interface.

@phuslu
Copy link
Contributor Author

phuslu commented May 19, 2024

Thanks. In my understanding the http.ResponseWriter only can be used in server side. (Please correct me if I'm wrong)

How to unwrap the stream in client side (*http.Response), my existing code is here

@marten-seemann
Copy link
Member

You'll need to take the path via the SingleDestinationRoundTripper then.

@phuslu
Copy link
Contributor Author

phuslu commented May 19, 2024

Last question, shall/do we have a RoundTripOpt to let this underlying stream stay opening?

https://github.com/quic-go/quic-go/blob/v0.44.0/http3/client.go#L299

@phuslu
Copy link
Contributor Author

phuslu commented May 19, 2024

Finally I gave up this approach, I turn to another way with more compatibility and but lower performance in phuslu/liner@1054f3b

If the stream unwarp of *http.Response in quic-go/http3 comes back in future, please let me know. thanks again.

@phuslu phuslu closed this as completed May 19, 2024
@marten-seemann
Copy link
Member

Please take a look at the WebTransport dialer: https://github.com/quic-go/webtransport-go/blob/master/client.go

I believe it does exactly what you need.

@phuslu
Copy link
Contributor Author

phuslu commented May 19, 2024

Understood, but currently I'd like keep unique/same logic in server side, like https://github.com/phuslu/liner/blob/master/handler_http_forward.go#L278-L298

@marten-seemann
Copy link
Member

There’s no change to the server side. This is purely a client side API change.

@phuslu
Copy link
Contributor Author

phuslu commented May 21, 2024

thanks for your patience, finally I have a modified webtransport-go dialer of https://github.com/phuslu/liner/blob/master/dialer_http3.go thanks again!

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

No branches or pull requests

2 participants