fix redirect
This commit is contained in:
@ -158,6 +158,12 @@ func buildConfigFromCmd(services, nodes stringList) (*config.Config, error) {
|
||||
hopConfig.Interface = v
|
||||
md.Del("interface")
|
||||
}
|
||||
if v := metadata.GetInt(md, "so_mark"); v > 0 {
|
||||
hopConfig.SockOpts = &config.SockOptsConfig{
|
||||
Mark: v,
|
||||
}
|
||||
md.Del("so_mark")
|
||||
}
|
||||
|
||||
chain.Hops = append(chain.Hops, hopConfig)
|
||||
}
|
||||
@ -354,6 +360,12 @@ func buildServiceConfig(url *url.URL) (*config.ServiceConfig, error) {
|
||||
svc.Interface = v
|
||||
md.Del("interface")
|
||||
}
|
||||
if v := metadata.GetInt(md, "so_mark"); v > 0 {
|
||||
svc.SockOpts = &config.SockOptsConfig{
|
||||
Mark: v,
|
||||
}
|
||||
md.Del("so_mark")
|
||||
}
|
||||
|
||||
if svc.Forwarder != nil {
|
||||
svc.Forwarder.Selector = parseSelector(md)
|
||||
|
@ -53,7 +53,8 @@ import (
|
||||
// Register handlers
|
||||
_ "github.com/go-gost/x/handler/dns"
|
||||
_ "github.com/go-gost/x/handler/http2"
|
||||
_ "github.com/go-gost/x/handler/redirect"
|
||||
_ "github.com/go-gost/x/handler/redirect/tcp"
|
||||
_ "github.com/go-gost/x/handler/redirect/udp"
|
||||
_ "github.com/go-gost/x/handler/relay"
|
||||
_ "github.com/go-gost/x/handler/sni"
|
||||
_ "github.com/go-gost/x/handler/ss"
|
||||
@ -77,6 +78,7 @@ import (
|
||||
_ "github.com/go-gost/x/listener/obfs/tls"
|
||||
_ "github.com/go-gost/x/listener/pht"
|
||||
_ "github.com/go-gost/x/listener/quic"
|
||||
_ "github.com/go-gost/x/listener/redirect/tcp"
|
||||
_ "github.com/go-gost/x/listener/redirect/udp"
|
||||
_ "github.com/go-gost/x/listener/ssh"
|
||||
_ "github.com/go-gost/x/listener/sshd"
|
||||
|
Reference in New Issue
Block a user