@@ -136,13 +136,15 @@ def _transport_ws(self, config: WebSocketTransportConfig, path: str) -> dict:
136136
137137 def _transport_grpc (self , config : GRPCTransportConfig , path : str ) -> dict :
138138 """Handle GRPC transport - only gets GRPC config"""
139- return self ._normalize_and_remove_none_values ({
140- "type" : "grpc" ,
141- "service_name" : path ,
142- "idle_timeout" : f"{ config .idle_timeout } s" if config .idle_timeout else "15s" ,
143- "ping_timeout" : f"{ config .health_check_timeout } s" if config .health_check_timeout else "15s" ,
144- "permit_without_stream" : config .permit_without_stream ,
145- })
139+ return self ._normalize_and_remove_none_values (
140+ {
141+ "type" : "grpc" ,
142+ "service_name" : path ,
143+ "idle_timeout" : f"{ config .idle_timeout } s" if config .idle_timeout else "15s" ,
144+ "ping_timeout" : f"{ config .health_check_timeout } s" if config .health_check_timeout else "15s" ,
145+ "permit_without_stream" : config .permit_without_stream ,
146+ }
147+ )
146148
147149 def _transport_httpupgrade (self , config : WebSocketTransportConfig , path : str ) -> dict :
148150 """Handle HTTPUpgrade transport - only gets WS config (similar to WS)"""
@@ -190,7 +192,10 @@ def _apply_tls(self, tls_config: TLSConfig, fragment_settings: dict | None = Non
190192 if isinstance (tls_config .sni , str )
191193 else (tls_config .sni [0 ] if tls_config .sni else None ),
192194 "insecure" : tls_config .allowinsecure ,
193- "utls" : {"enabled" : bool (tls_config .fingerprint ) or tls_config .tls == "reality" , "fingerprint" : tls_config .fingerprint }
195+ "utls" : {
196+ "enabled" : bool (tls_config .fingerprint ) or tls_config .tls == "reality" ,
197+ "fingerprint" : tls_config .fingerprint ,
198+ }
194199 if tls_config .fingerprint or tls_config .tls == "reality"
195200 else None ,
196201 "alpn" : tls_config .alpn_singbox , # Pre-formatted for sing-box!
@@ -322,7 +327,7 @@ def _build_outbound(
322327 if inbound .mux_settings and (singbox_mux := inbound .mux_settings .get ("sing_box" )) and singbox_mux .get ("enable" ):
323328 # Filter out the enable field as it's not part of singbox multiplex config
324329 multiplex_config = {k : v for k , v in singbox_mux .items () if k != "enable" }
325-
330+
326331 # Handle brutal configuration - only include if brutal.enable is True
327332 if "brutal" in multiplex_config :
328333 brutal_config = multiplex_config ["brutal" ]
@@ -332,7 +337,7 @@ def _build_outbound(
332337 else :
333338 # Remove brutal config entirely if enable is False or brutal is None
334339 multiplex_config .pop ("brutal" , None )
335-
340+
336341 multiplex_config = self ._normalize_and_remove_none_values (multiplex_config )
337342 config ["multiplex" ] = multiplex_config
338343
0 commit comments