File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ async-trait = "0.1"
1818tokio-rustls = " 0.24"
1919rustls-native-certs = " 0.6"
2020serde = { version = " 1" , features = [" derive" ] }
21- serde_json = " 1 "
21+ json5 = " 0.4 "
2222dns-parser = " 0.8"
2323futures-util = " 0.3"
2424bytes = " 1"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ mod utils;
88
99use crate :: { config:: Config , outbound:: ProxyOutBound } ;
1010
11- use std:: io:: Write ;
11+ use std:: io:: { Read , Write } ;
1212use tokio:: {
1313 io:: { AsyncRead , AsyncWrite } ,
1414 sync:: RwLock ,
@@ -27,8 +27,12 @@ async fn main() {
2727 let stdin = std:: io:: stdin ( ) ;
2828 let mut stdout = std:: io:: stdout ( ) ;
2929
30- let mut config: Config =
31- serde_json:: from_reader ( std:: fs:: File :: open ( "./config.json" ) . unwrap ( ) ) . unwrap ( ) ;
30+ let mut config = String :: new ( ) ;
31+ std:: fs:: File :: open ( "./config.json" )
32+ . unwrap ( )
33+ . read_to_string ( & mut config)
34+ . unwrap ( ) ;
35+ let mut config: Config = json5:: from_str ( & config) . unwrap ( ) ;
3236
3337 let mut proxy_stack: Vec < Box < dyn ProxyOutBound > > = vec ! [ Box :: new( outbound:: Raw :: new( ) ) ] ;
3438 if let Some ( proxies) = & mut config. proxies {
You can’t perform that action at this time.
0 commit comments