Browse Source

Fix: HTTP sniff

秋のかえで 3 years ago
parent
commit
82c42fc32c
2 changed files with 4 additions and 1 deletions
  1. 1 1
      app/dispatcher/default.go
  2. 3 0
      app/reverse/portal.go

+ 1 - 1
app/dispatcher/default.go

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

+ 3 - 0
app/reverse/portal.go

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