mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-10-19 03:41:46 +00:00
mux: run http server if gateway | grpcWeb | react | mux is defined
goroutines: use errgroup Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -22,9 +22,9 @@ func (s *service) gateway(opts ...runtime.ServeMuxOption) error {
|
||||
return err
|
||||
}
|
||||
if s.opts.gatewayPrefix != "" {
|
||||
s.opts.mux.Handle(s.opts.gatewayPrefix+"/", http.StripPrefix(s.opts.gatewayPrefix, wsproxy.WebsocketProxy(mux)))
|
||||
s.lazyMux().Handle(s.opts.gatewayPrefix+"/", http.StripPrefix(s.opts.gatewayPrefix, wsproxy.WebsocketProxy(mux)))
|
||||
} else {
|
||||
s.opts.mux.Handle("/", wsproxy.WebsocketProxy(mux))
|
||||
s.lazyMux().Handle("/", wsproxy.WebsocketProxy(mux))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user