add auther config

This commit is contained in:
ginuerzh
2022-02-12 00:33:20 +08:00
parent c1bf501734
commit a8a6bbc3a3
37 changed files with 261 additions and 183 deletions

View File

@ -54,9 +54,9 @@ func (h *tapHandler) Init(md md.Metadata) (err error) {
return
}
if len(h.options.Auths) > 0 {
method := h.options.Auths[0].Username()
password, _ := h.options.Auths[0].Password()
if h.options.Auth != nil {
method := h.options.Auth.Username()
password, _ := h.options.Auth.Password()
h.cipher, err = ss.ShadowCipher(method, password, h.md.key)
if err != nil {
return