-
Notifications
You must be signed in to change notification settings - Fork 956
Feat: Add Experimental Triple HTTP/3 Support #2916
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds experimental HTTP/3 support to the Triple protocol over QUIC, enabling users to choose between HTTP/2 and HTTP/3 transports. It updates server and client startup logic, configuration types, and compatibility layers to include an Http3Enable
option and Http3Config
.
- Introduce
Http3Enable
option andHttp3Config
YAML fields for server and client. - Extend server (
Run
,startHttp3
,Stop
,GracefulStop
) and client (http3.Transport
) to handle HTTP/3. - Update config, compatibility, and constants to support
CallHTTP3
.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
protocol/triple/triple_protocol/server.go | Added Run , startHttp3 , Stop , GracefulStop and HTTP/3 fields (addr , http3Srv ) |
protocol/triple/server.go | Integrated HTTP/2/3 selection logic and TLS handling |
protocol/triple/client.go | Added HTTP/3 transport setup using QUIC in newClientManager |
protocol/triple/options.go | Introduced Http3Enable option |
common/constant/key.go | Defined new CallHTTP3 constant |
global/http3_config.go | New Http3Config type with clone/default methods |
global/triple_config.go | Extended TripleConfig with Http3 field |
global/reference_config.go | Updated ReferenceConfig to include ClientProtocolConfig |
global/client_protocol_config.go | Renamed ProtocolClientConfig to ClientProtocolConfig |
config/http3_config.go | New config.Http3Config type |
config/triple_config.go | Extended config.TripleConfig with Http3 field |
config/reference_config.go | Renamed Methods to MethodsConfig and added ProtocolClientConfig |
config/client_protocol_config.go | Added config.ClientProtocolConfig definition |
protocol/options.go | Updated ClientOptions.ProtocolClient type |
compat.go | Updated compatibility conversions to include HTTP/3 config |
go.mod | Bumped dependencies and added quic-go /qpack modules |
global/config_test.go | Added tests for TripleConfig and Http3Config cloning |
Comments suppressed due to low confidence (2)
protocol/triple/client.go:259
- Missing import for fmt; add
import "fmt"
at the top to resolvefmt.Errorf
usage.
return nil, fmt.Errorf("TRIPLE http3 client must have TLS config, but TLS config is nil")
protocol/triple/triple_protocol/server.go:23
- [nitpick] Imports are split across multiple blocks and mixed order; consider consolidating standard library and external imports into a single organized import block.
"errors"
// Whether to enable HTTP/3 negotiation. | ||
// If set to false, HTTP/2 alt-svc negotiation will be skipped, | ||
// enabling HTTP/3 but disabling HTTP/2 on the consumer side. | ||
// negotiation bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
// TODO: Refactor to support starting HTTP/2 and HTTP/3 servers simultaneously. | ||
// The current switch logic is mutually exclusive. Future work should allow enabling | ||
// both protocols, likely based on configuration, and run them concurrently. | ||
switch callProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comment!
According to my understanding, in order to support something like this (negotiation = true configuration, you must first start the HTTP/2 server, and use Alt-Svc in HTTP/2 to inform the client that HTTP/3 is supported.) Do you need to modify this logic? Change it to something like this? Pseudocode demonstration
func (s *Server) Run(tlsConf *tls.Config) error {
var wg sync.WaitGroup
var errChan = make(chan error, 2)
if s.config.EnableHTTP2 {
wg.Add(1)
go func() {
defer wg.Done()
if err := s.startHttp2(tlsConf); err != nil {
errChan <- fmt.Errorf("http2 error: %w", err)
}
}()
}
if s.config.EnableHTTP3 {
wg.Add(1)
go func() {
defer wg.Done()
if err := s.startHttp3(tlsConf); err != nil {
errChan <- fmt.Errorf("http3 error: %w", err)
}
}()
}
wg.Wait()
close(errChan)
for err := range errChan {
return err
}
return nil
}
This is just a question I have, no need to modify the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i will implement it in next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
What this PR does / Why we need it
This PR introduces experimental support for HTTP/3 to the Triple protocol. By running over QUIC, HTTP/3 provides significant performance advantages over HTTP/2, including:
Adding HTTP/3 support keeps the dubbo-go Triple protocol at the forefront of modern, high-performance web protocols and provides users with a powerful option for latency-sensitive services.
Main Changes
quic-go
as the underlying implementation for QUIC and HTTP/3.dubbo.protocols.triple.http3
to enable and control the HTTP/3 listener.tls.Config
has been reinforced. The server will fail to start if HTTP/3 is enabled without a valid TLS configuration.How to use
client and server mode
To enable HTTP/3, you must provide a vaild TLS configuration and set the http3Enable option in your code:
yaml file mode
To enable HTTP/3, you must provide a valid TLS configuration and enable the feature in your configuration file.
Checklist