mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
19 lines
335 B
Rust
19 lines
335 B
Rust
|
|
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;
|
||
|
|
}
|