feat: 新增--traffic-obfuscate

This commit is contained in:
liyuanhu 2025-04-23 10:03:27 +08:00
parent a86b20f9d5
commit c753617ee9
3 changed files with 6 additions and 1 deletions

1
.env
View File

@ -2,6 +2,7 @@ IS_DEBUG="true"
GRPC_ENDPOINT="10.66.66.234:9090"
COSMOS_ENDPOINT="http://10.66.66.234:26657"
ACCOUNT_NAME="ccvdexre"
TRAFFIC_OBFUSCATE="10.66.66.234:8180"
NODE_SECRET= "initial typical business width enforce buddy magic country piano head cable blossom gate caught disagree pepper moral pair vessel protect mixture deposit artwork liquid"
VIET_EVENTS_URL="ws://10.66.66.234:8080/events"
VITE_BASE_URL="http://10.66.66.234:8080"

View File

@ -23,6 +23,7 @@ pub struct CoreConfig {
pub node_secret: String,
pub passphrase: String,
pub data_path: String,
pub traffic_obfuscate: String,
}
impl Default for CoreConfig {
@ -54,6 +55,7 @@ impl Default for CoreConfig {
// 2. 在 `paw-gui/src-tauri/common` 文件夹下的 `build.rs` 中增加条件检查
// 在发布的情况下,应当从编译期环境变量中获取真实配置,而非默认配置
let traffic_obfuscate = env!("TRAFFIC_OBFUSCATE").to_string();
let account_name = env!("ACCOUNT_NAME").to_string();
let grpc_endpoint = env!("GRPC_ENDPOINT").to_string();
let cosmos_endpoint = env!("COSMOS_ENDPOINT").to_string();
@ -80,6 +82,7 @@ impl Default for CoreConfig {
node_secret,
passphrase: "".to_string(),
data_path,
traffic_obfuscate,
}
}
}
@ -105,6 +108,7 @@ impl CoreConfig {
format!("-nodeSecret={}", self.node_secret),
format!("-passphrase={}", self.passphrase),
format!("-data-path={}", self.data_path),
format!("-traffic-obfuscate={}", self.traffic_obfuscate),
];
args

View File

@ -216,7 +216,7 @@ async getDynamicRoutingEndpoint() : Promise<Result<string, string>> {
/** user-defined types **/
export type CircuitRequest = { name: string | null; inbound: string; outbound: string; multi_hop: number; fallback: boolean; rule_path: string | null; is_prefix: boolean }
export type CoreConfig = { socks_port: number; socks_user: string; socks_pass: string; api_port: number; secret: string; tun: boolean; log_file_path: string; traffic_gen_rule_path: string; dsn: string; debug: boolean; address_prefix: string; account_name: string; grpc_endpoint: string; cosmos_endpoint: string; node_secret: string; passphrase: string; data_path: string }
export type CoreConfig = { socks_port: number; socks_user: string; socks_pass: string; api_port: number; secret: string; tun: boolean; log_file_path: string; traffic_gen_rule_path: string; dsn: string; debug: boolean; address_prefix: string; account_name: string; grpc_endpoint: string; cosmos_endpoint: string; node_secret: string; passphrase: string; data_path: string; traffic_obfuscate: string }
/**
*
*/