1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-31 05:15:23 -05:00

basic auth in http server

This commit is contained in:
Darien Raymond
2017-10-26 21:44:13 +02:00
parent 12a0d6e0b9
commit 1d3c8098e9
5 changed files with 128 additions and 12 deletions

View File

@@ -1 +1,13 @@
package http
func (sc *ServerConfig) HasAccount(username, password string) bool {
if sc.Accounts == nil {
return false
}
p, found := sc.Accounts[username]
if !found {
return false
}
return p == password
}