mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
chore(router): Add grpc and grep-web api
Using connect-go package https://github.com/bufbuild/connect-go Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -9,6 +9,9 @@ import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
"golang.org/x/net/http2/h2c"
|
||||
)
|
||||
|
||||
func newHTTPServer(network, address, name string, handler http.Handler) (*Server, ServeFunction) {
|
||||
@@ -17,7 +20,7 @@ func newHTTPServer(network, address, name string, handler http.Handler) (*Server
|
||||
ReadTimeout: DefaultReadTimeOut,
|
||||
WriteTimeout: DefaultWriteTimeOut,
|
||||
MaxHeaderBytes: DefaultMaxHeaderBytes,
|
||||
Handler: handler,
|
||||
Handler: h2c.NewHandler(handler, &http2.Server{}),
|
||||
BaseContext: func(net.Listener) context.Context { return GetManager().HammerContext() },
|
||||
}
|
||||
server.OnShutdown = func() {
|
||||
|
||||
Reference in New Issue
Block a user