add http3 reverse proxy
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package http3
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
mdata "github.com/go-gost/core/metadata"
|
||||
@ -9,17 +8,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultAuthorizePath = "/authorize"
|
||||
defaultPushPath = "/push"
|
||||
defaultPullPath = "/pull"
|
||||
defaultBacklog = 128
|
||||
defaultBacklog = 128
|
||||
)
|
||||
|
||||
type metadata struct {
|
||||
authorizePath string
|
||||
pushPath string
|
||||
pullPath string
|
||||
backlog int
|
||||
backlog int
|
||||
|
||||
// QUIC config options
|
||||
keepAlivePeriod time.Duration
|
||||
@ -30,10 +23,6 @@ type metadata struct {
|
||||
|
||||
func (l *http3Listener) parseMetadata(md mdata.Metadata) (err error) {
|
||||
const (
|
||||
authorizePath = "authorizePath"
|
||||
pushPath = "pushPath"
|
||||
pullPath = "pullPath"
|
||||
|
||||
keepAlive = "keepAlive"
|
||||
keepAlivePeriod = "ttl"
|
||||
handshakeTimeout = "handshakeTimeout"
|
||||
@ -43,19 +32,6 @@ func (l *http3Listener) parseMetadata(md mdata.Metadata) (err error) {
|
||||
backlog = "backlog"
|
||||
)
|
||||
|
||||
l.md.authorizePath = mdutil.GetString(md, authorizePath)
|
||||
if !strings.HasPrefix(l.md.authorizePath, "/") {
|
||||
l.md.authorizePath = defaultAuthorizePath
|
||||
}
|
||||
l.md.pushPath = mdutil.GetString(md, pushPath)
|
||||
if !strings.HasPrefix(l.md.pushPath, "/") {
|
||||
l.md.pushPath = defaultPushPath
|
||||
}
|
||||
l.md.pullPath = mdutil.GetString(md, pullPath)
|
||||
if !strings.HasPrefix(l.md.pullPath, "/") {
|
||||
l.md.pullPath = defaultPullPath
|
||||
}
|
||||
|
||||
l.md.backlog = mdutil.GetInt(md, backlog)
|
||||
if l.md.backlog <= 0 {
|
||||
l.md.backlog = defaultBacklog
|
||||
|
Reference in New Issue
Block a user