Example #1
0
        public static bool TryParseMode(string value, out SimpleObfsPluginMode mode)
        {
            mode = default;

            if (string.IsNullOrWhiteSpace(value))
            {
                return(false);
            }

            switch (value.Trim().ToLower())
            {
            case "tls":
                mode = SimpleObfsPluginMode.TLS;
                break;

            case "http":
                mode = SimpleObfsPluginMode.HTTP;
                break;

            default:
                return(false);
            }
            ;
            return(true);
        }
Example #2
0
 static string FormatSimpleObfsPluginMode(SimpleObfsPluginMode mode)
 {
     return(mode switch
     {
         SimpleObfsPluginMode.HTTP => "http",
         SimpleObfsPluginMode.TLS => "tls",
         _ => throw new NotImplementedException(),
     });