chore: bump Go dependencies
This commit is contained in:
parent
b3d1e4cf13
commit
e118df5dfd
1119 changed files with 126580 additions and 8706 deletions
23
vendor/github.com/labstack/echo/v4/middleware/proxy.go
generated
vendored
23
vendor/github.com/labstack/echo/v4/middleware/proxy.go
generated
vendored
|
|
@ -5,6 +5,7 @@ package middleware
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
|
|
@ -130,7 +131,21 @@ var DefaultProxyConfig = ProxyConfig{
|
|||
ContextKey: "target",
|
||||
}
|
||||
|
||||
func proxyRaw(t *ProxyTarget, c echo.Context) http.Handler {
|
||||
func proxyRaw(t *ProxyTarget, c echo.Context, config ProxyConfig) http.Handler {
|
||||
var dialFunc func(ctx context.Context, network, addr string) (net.Conn, error)
|
||||
if transport, ok := config.Transport.(*http.Transport); ok {
|
||||
if transport.TLSClientConfig != nil {
|
||||
d := tls.Dialer{
|
||||
Config: transport.TLSClientConfig,
|
||||
}
|
||||
dialFunc = d.DialContext
|
||||
}
|
||||
}
|
||||
if dialFunc == nil {
|
||||
var d net.Dialer
|
||||
dialFunc = d.DialContext
|
||||
}
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
in, _, err := c.Response().Hijack()
|
||||
if err != nil {
|
||||
|
|
@ -138,13 +153,11 @@ func proxyRaw(t *ProxyTarget, c echo.Context) http.Handler {
|
|||
return
|
||||
}
|
||||
defer in.Close()
|
||||
|
||||
out, err := net.Dial("tcp", t.URL.Host)
|
||||
out, err := dialFunc(c.Request().Context(), "tcp", t.URL.Host)
|
||||
if err != nil {
|
||||
c.Set("_error", echo.NewHTTPError(http.StatusBadGateway, fmt.Sprintf("proxy raw, dial error=%v, url=%s", err, t.URL)))
|
||||
return
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
// Write header
|
||||
err = r.Write(out)
|
||||
|
|
@ -365,7 +378,7 @@ func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc {
|
|||
// Proxy
|
||||
switch {
|
||||
case c.IsWebSocket():
|
||||
proxyRaw(tgt, c).ServeHTTP(res, req)
|
||||
proxyRaw(tgt, c, config).ServeHTTP(res, req)
|
||||
default: // even SSE requests
|
||||
proxyHTTP(tgt, c, config).ServeHTTP(res, req)
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/labstack/echo/v4/middleware/rate_limiter.go
generated
vendored
2
vendor/github.com/labstack/echo/v4/middleware/rate_limiter.go
generated
vendored
|
|
@ -191,7 +191,7 @@ NewRateLimiterMemoryStoreWithConfig returns an instance of RateLimiterMemoryStor
|
|||
with the provided configuration. Rate must be provided. Burst will be set to the rounded down value of
|
||||
the configured rate if not provided or set to 0.
|
||||
|
||||
The build-in memory store is usually capable for modest loads. For higher loads other
|
||||
The built-in memory store is usually capable for modest loads. For higher loads other
|
||||
store implementations should be considered.
|
||||
|
||||
Characteristics:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue