Merge branch 'master' into 2750-conflicts

pull/2750/head
Kslr 2020-10-02 06:52:29 +08:00 committed by GitHub
commit 58694e75d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

1
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1 @@
Please Move to https://github.com/v2fly/v2ray-core/pulls

View File

@ -1,3 +1,7 @@
# Move To https://github.com/v2fly/v2ray-core
***
# Project V
![](https://github.com/v2fly/v2ray-core/workflows/Test/badge.svg)
[![codecov.io][3]][4] [![GoDoc][5]][6] [![codebeat][7]][8] [![Downloads][9]][10] [![Downloads][11]][12]

View File

@ -166,4 +166,4 @@ func init() {
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
return NewManager(ctx, config.(*Config))
}))
}
}

View File

@ -111,7 +111,7 @@ Start:
if len(s.config.Accounts) > 0 {
user, pass, ok := parseBasicAuth(request.Header.Get("Proxy-Authorization"))
if !ok || !s.config.HasAccount(user, pass) {
return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\n\r\n")))
return common.Error2(conn.Write([]byte("HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\nConnection: close\r\n\r\n")))
}
if inbound != nil {
inbound.User.Email = user

View File

@ -190,13 +190,12 @@ func (v *TimedUserValidator) Remove(email string) bool {
v.Lock()
defer v.Unlock()
email = strings.ToLower(email)
idx := -1
for i, u := range v.users {
if strings.EqualFold(u.user.Email, email) {
for i := range v.users {
if strings.EqualFold(v.users[i].user.Email, email) {
idx = i
var cmdkeyfl [16]byte
copy(cmdkeyfl[:], u.user.Account.(*MemoryAccount).ID.CmdKey())
copy(cmdkeyfl[:], v.users[i].user.Account.(*MemoryAccount).ID.CmdKey())
v.aeadDecoderHolder.RemoveUser(cmdkeyfl)
break
}