update cmd
This commit is contained in:
@ -89,8 +89,8 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn) {
|
||||
feature := f.(*relay.UserAuthFeature)
|
||||
user, pass = feature.Username, feature.Password
|
||||
}
|
||||
if f.Type() == relay.FeatureTargetAddr {
|
||||
feature := f.(*relay.TargetAddrFeature)
|
||||
if f.Type() == relay.FeatureAddr {
|
||||
feature := f.(*relay.AddrFeature)
|
||||
target = net.JoinHostPort(feature.Host, strconv.Itoa(int(feature.Port)))
|
||||
}
|
||||
}
|
||||
|
@ -16,12 +16,12 @@ type metadata struct {
|
||||
|
||||
func (h *relayHandler) parseMetadata(md md.Metadata) (err error) {
|
||||
const (
|
||||
authsKey = "auths"
|
||||
users = "users"
|
||||
readTimeout = "readTimeout"
|
||||
retryCount = "retry"
|
||||
)
|
||||
|
||||
if v, _ := md.Get(authsKey).([]interface{}); len(v) > 0 {
|
||||
if v, _ := md.Get(users).([]interface{}); len(v) > 0 {
|
||||
authenticator := auth.NewLocalAuthenticator(nil)
|
||||
for _, auth := range v {
|
||||
if s, _ := auth.(string); s != "" {
|
||||
|
Reference in New Issue
Block a user