chore: add protocols enum

This commit is contained in:
Keivan-sf committed 2023-10-08 20:46:52 +03:30
1 parent 29348fcc10
commit a77da502ed
2 files changed
+34 -1

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
pub enum protocols {
Vmess,
Vless,
Shadowsocks,
Trojan,
Socks,
Http,
}
pub fn get_uri_format(uri: &str) -> Option<protocols> {
if uri.starts_with("vmess://") {
return Some(protocols::Vmess);
}
if uri.starts_with("vless://") {
return Some(protocols::Vless);
}
return None;
}