mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-15 00:15:11 +00:00
fixed bug
This commit is contained in:
+9
-2
@@ -95,8 +95,15 @@ fn decode(encoded: &str, need_qrcode: bool) {
|
||||
let svrconfig = ServerConfig::basic(addr.to_owned(), port.parse().unwrap(),
|
||||
pwd.to_owned(), method.parse().unwrap());
|
||||
|
||||
let svrconfig_json = svrconfig.to_json();
|
||||
println!("{}", as_pretty_json(&svrconfig_json));
|
||||
let config = Config {
|
||||
server: vec![svrconfig],
|
||||
local: None,
|
||||
enable_udp: false,
|
||||
timeout: None,
|
||||
};
|
||||
|
||||
let config_json = config.to_json();
|
||||
println!("{}", as_pretty_json(&config_json));
|
||||
|
||||
if need_qrcode {
|
||||
print_qrcode(encoded);
|
||||
|
||||
@@ -453,6 +453,8 @@ impl json::ToJson for Config {
|
||||
obj.insert("local_port".to_owned(), Json::U64(l.port() as u64));
|
||||
}
|
||||
|
||||
obj.insert("enable_udp".to_owned(), Json::Boolean(self.enable_udp));
|
||||
|
||||
Json::Object(obj)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user