mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
add h2c/http2 support with WithoutCmux option
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -334,6 +334,13 @@ func WithReactUI(fs fs.FS, subpath string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithoutCmux disables the use of cmux for http support to instead use grpc.Server.ServeHTTP method when http support is enabled
|
||||
func WithoutCmux() Option {
|
||||
return func(o *options) {
|
||||
o.withoutCmux = true
|
||||
}
|
||||
}
|
||||
|
||||
type options struct {
|
||||
ctx context.Context
|
||||
name string
|
||||
@ -381,6 +388,7 @@ type options struct {
|
||||
|
||||
error error
|
||||
gatewayPrefix string
|
||||
withoutCmux bool
|
||||
}
|
||||
|
||||
func (o *options) Name() string {
|
||||
@ -499,6 +507,10 @@ func (o *options) GatewayOpts() []runtime.ServeMuxOption {
|
||||
return o.gatewayOpts
|
||||
}
|
||||
|
||||
func (o *options) WithoutCmux() bool {
|
||||
return o.withoutCmux
|
||||
}
|
||||
|
||||
func (o *options) parseTLSConfig() error {
|
||||
if o.tlsConfig != nil {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user