add router handler option

This commit is contained in:
ginuerzh
2021-12-31 00:03:24 +08:00
parent a430384bba
commit 9769efe33c
35 changed files with 98 additions and 281 deletions

View File

@ -10,14 +10,12 @@ import (
type metadata struct {
authenticator auth.Authenticator
readTimeout time.Duration
retryCount int
}
func (h *socks4Handler) parseMetadata(md mdata.Metadata) (err error) {
const (
users = "users"
readTimeout = "readTimeout"
retryCount = "retry"
)
if auths := mdata.GetStrings(md, users); len(auths) > 0 {
@ -31,6 +29,5 @@ func (h *socks4Handler) parseMetadata(md mdata.Metadata) (err error) {
}
h.md.readTimeout = mdata.GetDuration(md, readTimeout)
h.md.retryCount = mdata.GetInt(md, retryCount)
return
}