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); }
static string FormatSimpleObfsPluginMode(SimpleObfsPluginMode mode) { return(mode switch { SimpleObfsPluginMode.HTTP => "http", SimpleObfsPluginMode.TLS => "tls", _ => throw new NotImplementedException(), });