feat: userpass auth

This commit is contained in:
Toby
2023-08-06 12:11:46 -07:00
parent 601ad6b61c
commit 7307eea2a8
8 changed files with 241 additions and 3 deletions

View File

@@ -231,7 +231,13 @@ func (c *clientConfig) URI() string {
}
var user *url.Userinfo
if c.Auth != "" {
user = url.User(c.Auth)
// We need to handle the special case of user:pass pairs
rs := strings.SplitN(c.Auth, ":", 2)
if len(rs) == 2 {
user = url.UserPassword(rs[0], rs[1])
} else {
user = url.User(c.Auth)
}
}
u := url.URL{
Scheme: "hysteria2",