Refactoring
Refactored Protocol.Name -> Protocol.Type; added Encapsulation field Refactored TLS parsing; added support for ALPN
This commit is contained in:
@@ -41,5 +41,5 @@ func main() {
|
||||
os.Exit(3)
|
||||
}
|
||||
|
||||
fmt.Printf("Protocol at address %q is %s version %s (confidence %g%%)\n", address, protocol.Name, protocol.Version, confidence*100)
|
||||
fmt.Printf("Protocol at address %q is %s version %s (confidence %g%%)\n", address, protocol.Type, protocol.Version, confidence*100)
|
||||
}
|
||||
|
@@ -42,11 +42,11 @@ func main() {
|
||||
if p == nil {
|
||||
return errors.New("no protocol detected")
|
||||
}
|
||||
if !accept[p.Name] {
|
||||
return fmt.Errorf("protocol %s is not accepted", p.Name)
|
||||
if !accept[p.Type] {
|
||||
return fmt.Errorf("protocol %s is not accepted", p.Type)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "Accepting protocol %s version %s initiated by %s\n",
|
||||
p.Name, p.Version, dir)
|
||||
p.Type, p.Version, dir)
|
||||
return nil
|
||||
})
|
||||
defer func() { _ = c.Close() }()
|
||||
|
@@ -81,7 +81,7 @@ func proxy(client net.Conn, target string) {
|
||||
log.Printf("protocol detection failed: %v", result.Error)
|
||||
} else {
|
||||
log.Printf("detected protocol %s version %s initiated by %s",
|
||||
result.Protocol.Name, result.Protocol.Version, result.Direction)
|
||||
result.Protocol.Type, result.Protocol.Version, result.Direction)
|
||||
}
|
||||
|
||||
// Wait for the multiplexing to finish.
|
||||
|
Reference in New Issue
Block a user