mirror of
https://github.com/fatedier/frp.git
synced 2025-07-29 01:07:38 +00:00
code optimization (#3625)
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"github.com/samber/lo"
|
||||
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
"github.com/fatedier/frp/pkg/consts"
|
||||
)
|
||||
|
||||
func validateProxyBaseConfigForClient(c *v1.ProxyBaseConfig) error {
|
||||
@@ -134,7 +133,7 @@ func validateTCPMuxProxyConfigForClient(c *v1.TCPMuxProxyConfig) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !lo.Contains([]string{consts.HTTPConnectTCPMultiplexer}, c.Multiplexer) {
|
||||
if !lo.Contains([]string{string(v1.TCPMultiplexerHTTPConnect)}, c.Multiplexer) {
|
||||
return fmt.Errorf("not support multiplexer: %s", c.Multiplexer)
|
||||
}
|
||||
return nil
|
||||
@@ -197,7 +196,7 @@ func validateUDPProxyConfigForServer(c *v1.UDPProxyConfig, s *v1.ServerConfig) e
|
||||
}
|
||||
|
||||
func validateTCPMuxProxyConfigForServer(c *v1.TCPMuxProxyConfig, s *v1.ServerConfig) error {
|
||||
if c.Multiplexer == consts.HTTPConnectTCPMultiplexer &&
|
||||
if c.Multiplexer == string(v1.TCPMultiplexerHTTPConnect) &&
|
||||
s.TCPMuxHTTPConnectPort == 0 {
|
||||
return fmt.Errorf("tcpmux with multiplexer httpconnect not supported because this feature is not enabled in server")
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ var (
|
||||
"wss",
|
||||
}
|
||||
|
||||
SupportedAuthMethods = []string{
|
||||
SupportedAuthMethods = []v1.AuthMethod{
|
||||
"token",
|
||||
"oidc",
|
||||
}
|
||||
|
Reference in New Issue
Block a user