From 2bfa5baee07f9e17357191137d977b0177e175bd Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Wed, 13 May 2020 18:51:30 +0800 Subject: [PATCH] =?UTF-8?q?ss-obfs-host=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/resource-parser.js | 53 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index 5391d6f..0f60e9f 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -280,6 +280,32 @@ function Rule_Policy(content){ //增加、替换 policy } else{return ""}//if RuleK1 check } +// Vmess obfs 参数 +function Pobfs(jsonl,Pcert,Ptls13){ + var obfsi=[]; + var cert=Pcert; + tcert= cert==0? "tls-verification=false":"tls-verification=true"; + tls13= Ptls13==1? "tls13=true":"tls13=false" + if(jsonl.net=="ws" && jsonl.tls=="tls"){ + obfs0="obfs=wss, "+tcert+", "+tls13+", "; + uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:"obfs-uri=/"; + host0= jsonl.host!=""? "obfs-host="+jsonl.host+",":""; + obfsi.push(obfs0+host0+uri0) + return obfsi.join(", ") + }else if(jsonl.net=="ws"){ + obfs0="obfs=ws"; + uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:"obfs-uri=/"; + host0= jsonl.host!=""? "obfs-host="+jsonl.host+",":""; + obfsi.push(obfs0,host0+uri0); + return obfsi.join(", ") + }else if(jsonl.tls=="tls"){ + obfs0="obfs=over-tls, "+tcert+", "+tls13; + uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:""; + host0=jsonl.host!=""? ", obfs-host="+jsonl.host:""; + obfsi.push(obfs0+host0) + return obfsi.join(", ") + } +} //V2RayN 订阅转换成 QUANX 格式 function V2QX(subs,Pudp,Ptfo,Pcert,Ptls13){ @@ -367,33 +393,6 @@ function filter(servers,Pin,Pout){ return Nlist } -// Vmess obfs 参数 -function Pobfs(jsonl,Pcert,Ptls13){ - var obfsi=[]; - var cert=Pcert; - tcert= cert==0? "tls-verification=false":"tls-verification=true"; - tls13= Ptls13==1? "tls13=true":"tls13=false" - if(jsonl.net=="ws" && jsonl.tls=="tls"){ - obfs0="obfs=wss, "+tcert+", "+tls13+", "; - uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:"obfs-uri=/"; - host0= jsonl.host!=""? "obfs-host="+jsonl.host+",":""; - obfsi.push(obfs0+host0+uri0) - return obfsi.join(", ") - }else if(jsonl.net=="ws"){ - obfs0="obfs=ws"; - uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:"obfs-uri=/"; - host0= jsonl.host!=""? "obfs-host="+jsonl.host+",":""; - obfsi.push(obfs0,host0+uri0); - return obfsi.join(", ") - }else if(jsonl.tls=="tls"){ - obfs0="obfs=over-tls, "+tcert+", "+tls13+", "; - uri0=jsonl.path!=""? "obfs-uri="+jsonl.path:""; - host0=jsonl.host!=""? "obfs-host="+jsonl.host:""; - obfsi.push(obfs0+host0) - return obfsi.join(", ") - } -} - //SSR 转换 quanx 格式 function SSR2QX(subs,Pudp,Ptfo){ const $base64 = new Base64()