@@ -611,8 +611,9 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
611611 break ;
612612 case ProxyType::VLESS :
613613 singleproxy[" type" ] = " vless" ;
614- singleproxy[" packet-encoding" ] = " xudp" ;
615614 singleproxy[" tls" ] = true ;
615+ if (udp)
616+ singleproxy[" packet-encoding" ] = " xudp" ;
616617 if (!x.UUID .empty ())
617618 singleproxy[" uuid" ] = x.UUID ;
618619 if (!x.SNI .empty ())
@@ -621,14 +622,15 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
621622 singleproxy[" alpn" ] = x.Alpn ;
622623 if (!x.Fingerprint .empty ())
623624 singleproxy[" fingerprint" ] = x.Fingerprint ;
624- if (!x.Flow .empty ())
625- singleproxy[" flow" ] = x.Flow ;
626625 if (x.XTLS == 2 ) {
627626 singleproxy[" flow" ] = " xtls-rprx-vision" ;
627+ } else if (!x.Flow .empty ()) {
628+ singleproxy[" flow" ] = x.Flow ;
628629 }
629630 if (!x.PublicKey .empty () && !x.ShortID .empty ()) {
630631 singleproxy[" reality-opts" ][" public-key" ] = x.PublicKey ;
631632 singleproxy[" reality-opts" ][" short-id" ] = x.ShortID ;
633+ singleproxy[" client-fingerprint" ] = " random" ;
632634 }
633635 if (!scv.is_undef ())
634636 singleproxy[" skip-cert-verify" ] = scv.get ();
@@ -2626,9 +2628,11 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
26262628 if (!x.SNI .empty ())
26272629 proxy.AddMember (" sni" , rapidjson::StringRef (x.SNI .c_str ()), allocator);
26282630
2629- if (!x.Flow .empty ())
2631+ if (x.XTLS == 2 ) {
2632+ proxy.AddMember (" flow" , rapidjson::StringRef (" xtls-rprx-vision" ), allocator);
2633+ } else if (!x.Flow .empty ()) {
26302634 proxy.AddMember (" flow" , rapidjson::StringRef (x.Flow .c_str ()), allocator);
2631-
2635+ }
26322636 // TLS 配置
26332637 rapidjson::Value tls (rapidjson::kObjectType );
26342638 tls.AddMember (" enabled" , true , allocator);
@@ -2643,16 +2647,21 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
26432647 alpn.PushBack (rapidjson::StringRef (item.c_str ()), allocator);
26442648 tls.AddMember (" alpn" , alpn, allocator);
26452649 }
2646- if (x.XTLS == 2 ){
2647- if (!x.PublicKey .empty () && !x.ShortID .empty ()) {
2648- rapidjson::Value reality (rapidjson::kObjectType );
2649- reality.AddMember (" enabled" , true , allocator);
2650- if (!x.PublicKey .empty ())
2651- reality.AddMember (" public_key" , rapidjson::StringRef (x.PublicKey .c_str ()), allocator);
2652- if (!x.ShortID .empty ())
2653- reality.AddMember (" short_id" , rapidjson::StringRef (x.ShortID .c_str ()), allocator);
2654- tls.AddMember (" reality" , reality, allocator);
2655- }
2650+
2651+ if (!x.PublicKey .empty () && !x.ShortID .empty ()) {
2652+ rapidjson::Value reality (rapidjson::kObjectType );
2653+ reality.AddMember (" enabled" , true , allocator);
2654+ if (!x.PublicKey .empty ())
2655+ reality.AddMember (" public_key" , rapidjson::StringRef (x.PublicKey .c_str ()), allocator);
2656+ if (!x.ShortID .empty ())
2657+ reality.AddMember (" short_id" , rapidjson::StringRef (x.ShortID .c_str ()), allocator);
2658+ tls.AddMember (" reality" , reality, allocator);
2659+
2660+ rapidjson::Value utls (rapidjson::kObjectType );
2661+ utls.AddMember (" enable" ,true ,allocator);
2662+ std::array<std::string, 6 > fingerprints = {" chrome" , " firefox" , " safari" , " ios" , " edge" , " qq" };
2663+ utls.AddMember (" fingerprint" , rapidjson::Value (fingerprints[rand () % fingerprints.size ()].c_str (), allocator), allocator);
2664+ tls.AddMember (" utls" , utls, allocator);
26562665 }
26572666
26582667 proxy.AddMember (" tls" , tls, allocator);
0 commit comments