Support http inbound

resolves #2
This commit is contained in:
Keivan-sf
2025-07-26 19:25:55 +03:30
parent 3d0cbcfc66
commit 81c930193b
4 changed files with 42 additions and 32 deletions

View File

@@ -5,17 +5,22 @@ use std::process::exit;
mod uri_identifier;
mod vless;
pub fn create_json_config(uri: &str, socks_port: Option<u16>) -> String {
let config = create_config(uri, socks_port);
pub fn create_json_config(uri: &str, socks_port: Option<u16>, http_port: Option<u16>) -> String {
let config = create_config(uri, socks_port, http_port);
let serialized = serde_json::to_string(&config).unwrap();
return serialized;
}
pub fn create_config(uri: &str, socks_port: Option<u16>) -> config_models::Config {
pub fn create_config(
uri: &str,
socks_port: Option<u16>,
http_port: Option<u16>,
) -> config_models::Config {
let outbound_object = create_outbound_object(uri);
let inbound_config =
inbound_generator::generate_inbound_config(inbound_generator::InboundGenerationOptions {
socks_port,
http_port,
});
let config = config_models::Config {
outbounds: vec![outbound_object],