mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2026-05-11 00:11:23 +00:00
chore: add protocols enum
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user