@@ -261,27 +261,23 @@ def _transport_quic(self, config: QUICTransportConfig, path: str) -> dict:
261261 """Handle QUIC transport - only gets QUIC config"""
262262 host = config .host if isinstance (config .host , str ) else (config .host [0 ] if config .host else "" )
263263
264- return self ._normalize_and_remove_none_values (
265- {
266- "security" : host ,
267- "header" : {"type" : config .header_type },
268- "key" : path ,
269- }
270- )
264+ return self ._normalize_and_remove_none_values ({
265+ "security" : host ,
266+ "header" : {"type" : config .header_type },
267+ "key" : path ,
268+ })
271269
272270 def _transport_kcp (self , config : KCPTransportConfig , path : str ) -> dict :
273271 """Handle KCP transport - only gets KCP config"""
274- return self ._normalize_and_remove_none_values (
275- {
276- "mtu" : config .mtu if config .mtu is not None else 1350 ,
277- "tti" : config .tti if config .tti is not None else 50 ,
278- "uplinkCapacity" : config .uplink_capacity if config .uplink_capacity is not None else 5 ,
279- "downlinkCapacity" : config .downlink_capacity if config .downlink_capacity is not None else 20 ,
280- "congestion" : config .congestion ,
281- "readBufferSize" : config .read_buffer_size if config .read_buffer_size is not None else 2 ,
282- "writeBufferSize" : config .write_buffer_size if config .write_buffer_size is not None else 2 ,
283- }
284- )
272+ return self ._normalize_and_remove_none_values ({
273+ "mtu" : config .mtu if config .mtu is not None else 1350 ,
274+ "tti" : config .tti if config .tti is not None else 50 ,
275+ "uplinkCapacity" : config .uplink_capacity if config .uplink_capacity is not None else 5 ,
276+ "downlinkCapacity" : config .downlink_capacity if config .downlink_capacity is not None else 20 ,
277+ "congestion" : config .congestion ,
278+ "readBufferSize" : config .read_buffer_size if config .read_buffer_size is not None else 2 ,
279+ "writeBufferSize" : config .write_buffer_size if config .write_buffer_size is not None else 2 ,
280+ })
285281
286282 def _apply_transport (self , network : str , inbound : SubscriptionInboundData , path : str ) -> dict | None :
287283 """Apply transport settings using registry pattern"""
@@ -297,24 +293,23 @@ def _apply_tls(self, tls_config: TLSConfig, security: str) -> dict:
297293 sni = tls_config .sni if isinstance (tls_config .sni , str ) else (tls_config .sni [0 ] if tls_config .sni else None )
298294
299295 if security == "reality" :
300- return self ._normalize_and_remove_none_values (
301- {
302- "serverName" : sni ,
303- "fingerprint" : tls_config .fingerprint ,
304- "show" : False ,
305- "publicKey" : tls_config .reality_public_key ,
306- "shortId" : tls_config .reality_short_id ,
307- "spiderX" : tls_config .reality_spx ,
308- "mldsa65Verify" : tls_config .mldsa65_verify ,
309- }
310- )
296+ return self ._normalize_and_remove_none_values ({
297+ "serverName" : sni ,
298+ "fingerprint" : tls_config .fingerprint ,
299+ "show" : False ,
300+ "publicKey" : tls_config .reality_public_key ,
301+ "shortId" : tls_config .reality_short_id ,
302+ "spiderX" : tls_config .reality_spx ,
303+ "mldsa65Verify" : tls_config .mldsa65_verify ,
304+ })
311305 else : # tls
312306 config = {
313307 "serverName" : sni ,
314308 "allowInsecure" : tls_config .allowinsecure ,
315309 "show" : False ,
316310 "fingerprint" : tls_config .fingerprint ,
317311 "echConfigList" : tls_config .ech_config_list ,
312+ "pinnedPeerCertSha256" : tls_config .pinnedPeerCertSha256 ,
318313 }
319314 if tls_config .alpn_list :
320315 config ["alpn" ] = tls_config .alpn_list # Use list for xray
@@ -371,13 +366,11 @@ def _download_config(self, download_settings: SubscriptionInboundData, link_form
371366 sockopt = sockopt ,
372367 )
373368
374- return self ._normalize_and_remove_none_values (
375- {
376- "address" : download_settings .address ,
377- "port" : self ._select_port (download_settings .port ),
378- ** stream_settings ,
379- }
380- )
369+ return self ._normalize_and_remove_none_values ({
370+ "address" : download_settings .address ,
371+ "port" : self ._select_port (download_settings .port ),
372+ ** stream_settings ,
373+ })
381374
382375 # ========== Protocol Builders (Registry Methods) ==========
383376
0 commit comments