Fix: HTTP sniff

This commit is contained in:
秋のかえで 2022-11-29 09:27:28 +08:00
parent 9bbc3af6cd
commit 82c42fc32c
No known key found for this signature in database
GPG Key ID: 15FE3C27897EC4B5
2 changed files with 4 additions and 1 deletions

View File

@ -182,7 +182,7 @@ func shouldOverride(result SniffResult, domainOverride []string) bool {
protocolString = resComp.ProtocolForDomainResult()
}
for _, p := range domainOverride {
if strings.HasPrefix(p, protocolString) {
if strings.HasPrefix(protocolString, p) && strings.HasSuffix(protocolString, p) {
return true
}
if resultSubset, ok := result.(SnifferIsProtoSubsetOf); ok {

View File

@ -160,6 +160,9 @@ func (p *StaticMuxPicker) PickAvailable() (*mux.ClientWorker, error) {
if w.draining {
continue
}
if w.client.Closed() {
continue
}
if w.client.ActiveConnections() < minConn {
minConn = w.client.ActiveConnections()
minIdx = i