2026-11-25 17:38:41: merge [main:34e3ef7687c1506c4d688719cc57c11df2f68a5b];
This commit is contained in:
1 parent
45ae8cdd89
commit
6750784d6b
13 files changed
+176
-167
No files matched your search
@@ -33,6 +33,7 @@ func init() {
|
||||
}
|
||||
|
||||
var (
|
||||
// nolint: gochecknoglobals
|
||||
codeMap = map[int]codes.Code{
|
||||
http.StatusOK: codes.OK,
|
||||
http.StatusRequestTimeout: codes.Canceled,
|
||||
@@ -48,6 +49,7 @@ var (
|
||||
http.StatusInternalServerError: codes.Internal,
|
||||
http.StatusServiceUnavailable: codes.Unavailable,
|
||||
}
|
||||
// nolint: gochecknoglobals
|
||||
inverseCodeMap = map[codes.Code]int{}
|
||||
)
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// nolint: gochecknoglobals, mnd
|
||||
httpTransport = &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
DialContext: defaultTransportDialContext(&net.Dialer{
|
||||
|
||||
+4
-2
@@ -6,11 +6,12 @@ import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"isp-gate-service/httperrors"
|
||||
"isp-gate-service/request"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/tomakado/websocketproxy"
|
||||
"github.com/txix-open/isp-kit/errors"
|
||||
"isp-gate-service/httperrors"
|
||||
"isp-gate-service/request"
|
||||
)
|
||||
|
||||
type Ws struct {
|
||||
@@ -45,6 +46,7 @@ func (ws Ws) Handle(ctx *request.Context) error {
|
||||
proxy.Director = func(incoming *http.Request, out http.Header) {
|
||||
setHttpHeaders(ctx, out, ws.skipAuth)
|
||||
}
|
||||
// nolint: mnd
|
||||
proxy.Upgrader = &websocket.Upgrader{
|
||||
HandshakeTimeout: 5 * time.Second,
|
||||
ReadBufferSize: 1024,
|
||||
|
||||
Reference in new issue
Block a user