mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-17 23:37:52 +00:00
Move config models to src
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::config_models;
|
||||
use std::process::exit;
|
||||
|
||||
use self::config_models::{Config, Outbound};
|
||||
pub mod config_models;
|
||||
mod uri_identifier;
|
||||
mod vless;
|
||||
|
||||
@@ -11,16 +10,16 @@ pub fn create_json_config(uri: &str, socks_port: Option<u16>) -> String {
|
||||
return serialized;
|
||||
}
|
||||
|
||||
pub fn create_config(uri: &str, socks_port: Option<u16>) -> Config {
|
||||
pub fn create_config(uri: &str, socks_port: Option<u16>) -> config_models::Config {
|
||||
let outbound_object = create_outbound_object(uri);
|
||||
let config = Config {
|
||||
let config = config_models::Config {
|
||||
outbounds: vec![outbound_object],
|
||||
inbounds: None,
|
||||
};
|
||||
return config;
|
||||
}
|
||||
|
||||
pub fn create_outbound_object(uri: &str) -> Outbound {
|
||||
pub fn create_outbound_object(uri: &str) -> config_models::Outbound {
|
||||
let protocol = uri_identifier::get_uri_protocol(uri);
|
||||
match protocol {
|
||||
Some(uri_identifier::Protocols::Vless) => {
|
||||
|
||||
Reference in New Issue
Block a user