mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-17 07:27:51 +00:00
chore: add protocols enum
This commit is contained in:
18
src/parser/mod.rs
Normal file
18
src/parser/mod.rs
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user