diff --git a/base.py b/base.py index df3a55c..ec45872 100644 --- a/base.py +++ b/base.py @@ -198,6 +198,19 @@ class Extension: return extension return None + @classmethod + def test_connector(cls, data): + def test(prelude, data): + return data.find(prelude) == 0 + + for extension in cls.extensions: + if ( + extension.type == "connector" + and test(extension.prelude, data) + ): + return extension + return None + @classmethod def send_accept(cls, conn, method, success=True): if "tcp" in cls.protocols: