diff --git a/README.md b/README.md index 8fd1b6e..c7d2d54 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@  - WinXray V4.2 修复文件拖拽解析节点后空白的BUG! + WinXray V4.3 文件拖放现在支持了二维码图片的节点识别;传输现在添加了grpc! 导语: diff --git a/WinXray/WinXray.exe b/WinXray/WinXray.exe new file mode 100644 index 0000000..995225f Binary files /dev/null and b/WinXray/WinXray.exe differ diff --git a/WinXray/xray-core/LICENSE b/WinXray/xray-core/LICENSE new file mode 100644 index 0000000..2acac8a --- /dev/null +++ b/WinXray/xray-core/LICENSE @@ -0,0 +1 @@ +https://github.com/XTLS/Xray-core/blob/main/LICENSE \ No newline at end of file diff --git a/WinXray/xray-core/winXray-default-servers.json b/WinXray/xray-core/winXray-default-servers.json new file mode 100644 index 0000000..160afc6 --- /dev/null +++ b/WinXray/xray-core/winXray-default-servers.json @@ -0,0 +1,19 @@ +// 号开头为注释行。 +// 本文件用于指定默认服务器列表。 +// 本文件可以直接输入json格式的服务器数组( 服务器可以使用subscribeUrl字段指定订阅源地址,可以指定"autoConnect":false字段禁止自动连接 ) +// 也可以每行一个 vless://、vmess://、trojan、trojan-go、ss:// 等分享链接 +[ + { + "address":"服务器地址", + "port":443, // 服务器端口 + "id":"UUID或密码", // v2ray就指定UUID,shadowsocks在这里指定密码 + "network":"tcp", // 网络协议可以改为 "tcp", "ws" 等 + "security":"none", // 加密方法,vmess 默认为 auto, vless 默认为 none, shadowsocks也可以在这里指定加密方法,例如:"aes-256-gcm", + "protocol":"vless", // 协议可以更换为 "vless","vmess","shadowsocks","trojan","trojan-go" 等 + "host":"伪装主机域名", // 例如ws协议通过这个指定HTTP头里的host字段。 + "sni":"TLS域名", // 不指定使用host的值,如果host也没指定就使用 address的值 + "tls":"xtls", // 可以不写,值可以指定为 "","tls","xtls" 等 + "flow":"流控", // xtls需要用到的字段,可以不指定使用默认值 "xtls-rprx-direct" + "ps":"描述文本" + } +] \ No newline at end of file diff --git a/WinXray/xray-core/xray.exe b/WinXray/xray-core/xray.exe new file mode 100644 index 0000000..cdc3b1f Binary files /dev/null and b/WinXray/xray-core/xray.exe differ diff --git a/default.aproj b/default.aproj index 1cc73f7..cf60f48 100644 --- a/default.aproj +++ b/default.aproj @@ -1,5 +1,5 @@  - + diff --git a/forms/main/outbound.aardio b/forms/main/outbound.aardio index aa046d4..abb4231 100644 --- a/forms/main/outbound.aardio +++ b/forms/main/outbound.aardio @@ -53,11 +53,11 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.outboundConfig.security = "auto"; winform.cmbNetwork.items = { - "tcp";"kcp";"h2";"quic"; + "tcp";"ws";"kcp";"h2";"quic";"grpc"; } winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: xray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: Xray Core'; winform.editId.setCueBannerText("请输入 GUID"); } elseif(sel=="shadowsocks"){ @@ -71,7 +71,7 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.cmbNetwork.items = {"tcp";} winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: xray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: Xray Core'; winform.editId.setCueBannerText("请输入密码"); } elseif(sel=="ssr"){ @@ -98,11 +98,11 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.outboundConfig.security = "none"; winform.cmbNetwork.items = { - "tcp";"kcp";"h2";"quic"; + "tcp";"ws";"kcp";"h2";"quic";"grpc"; } winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: v2ray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: V2ray Core'; winform.editId.setCueBannerText("请输入 GUID"); } elseif(sel=="naive"){ @@ -125,7 +125,7 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.cmbNetwork.items = {"tcp";} winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: xray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: Xray Core'; winform.editId.setCueBannerText("请输入 用户名:密码"); } elseif(sel=="http" || sel=="https"){ @@ -135,7 +135,7 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.cmbNetwork.items = {"tcp";} winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: xray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: Xray Core'; winform.editId.setCueBannerText("请输入 用户名:密码"); } else { @@ -145,7 +145,7 @@ winform.cmbProtocol.onProtocolChange = function(){ winform.cmbNetwork.items = {"tcp";} winform.cmbNetwork.selIndex = 1; winform.outboundConfig.network = "tcp"; - winform.btnUpdateCore.text = '下载 / 更新支持组件: xray Core'; + winform.btnUpdateCore.text = '下载 / 更新支持组件: Xray Core'; winform.editId.setCueBannerText("请输入密码"); } } @@ -220,6 +220,7 @@ var editOutboundTip = { security = {"加密方式";"可省略,vmess协议默认为auto,vless协议默认为none"}; sni = {"TLS服务器名";"TLS客户端请求中的服务器名字段,如果不指定则默认取host或address字段值。"}; flow = {"流控";"目前仅用于选择 XTLS 的算法,省略时默认值为xtls-rprx-direct"}; + grpcSni = {"gRPC的ServiceName";"gRPC传输方式的ServiceName"}; obfs = {"混淆插件";"可选值:plain,http_simple,http_post,tls1.2_ticket_auth ..."}; obfsParam = {"混淆参数";"SSR 里的 obfs_param"}; networkParam = {"SSR网络协议参数";"SSR 里的 protocol_param"}; diff --git a/forms/main/xray.aardio b/forms/main/xray.aardio index 1fbdbc1..c71ff60 100644 --- a/forms/main/xray.aardio +++ b/forms/main/xray.aardio @@ -1036,6 +1036,26 @@ var accelerator = win.ui.accelerator({ //文件拖放 frmXray.onDropFiles = function(files){ for(i=1;#files;1){ + var bmp = gdip.bitmap(files[i]); + if(bmp){ + import zbar; + var scanner = zbar.scanner(); + scanner.config('qrcode.enable'); + scanner.scanBitmap(bmp,function(typeName,data){ + import win.clip; + win.clip.write(data); + + var outbounds = xray.outbounds.importFromString(data); + if(#outbounds){ + ..table.append(config.proxy.outbounds,outbounds); + publish("uiCommand.restartxrayCore"); + publish("outbounds.updateConfigJson"); + frmXray.msgOk("已成功导入" + #outbounds + "个服务器",1200); + return; + } + }) + } + var str=string.load(files[i]); if(str){ str = ..string.trim(str,'"\'\t\r\n '); @@ -1050,7 +1070,7 @@ frmXray.onDropFiles = function(files){ } } } - frmXray.msgFrown('未能在文件中导入节点!'); + //frmXray.msgFrown('未能在文件中导入节点!'); } import win.imageList; diff --git a/lib/xray/core/configJson.aardio b/lib/xray/core/configJson.aardio index 3f61767..ebb5605 100644 --- a/lib/xray/core/configJson.aardio +++ b/lib/xray/core/configJson.aardio @@ -184,6 +184,11 @@ write = function(jsonPath,outbound,sockPort,httpPort){ } } } + elseif( outbound.network == "grpc" ){ + ob.streamSettings.grpcSettings = { + serviceName = outbound.grpcSni; + } + } ..table.assign(proxyOutboundInCore,ob); } @@ -301,6 +306,11 @@ write = function(jsonPath,outbound,sockPort,httpPort){ } } } + elseif( outbound.network == "grpc" ){ + ob.streamSettings.grpcSettings = { + serviceName = outbound.grpcSni; + } + } ..table.assign(proxyOutboundInCore,ob); } diff --git a/lib/xray/outbounds.aardio b/lib/xray/outbounds.aardio index aeac2c0..a51fe6d 100644 --- a/lib/xray/outbounds.aardio +++ b/lib/xray/outbounds.aardio @@ -965,6 +965,7 @@ validOutbound = function(outbound){ outbound.id = outbound.password; outbound.password = null; } + if(outbound.uuid){ outbound.id = outbound.uuid; outbound.uuid = null; @@ -986,6 +987,13 @@ validOutbound = function(outbound){ outbound["ws-headers"] = null; } + var grpcOpts = outbound[["grpc-opts"]]; + if( grpcOpts ){ + if(grpcOpts[["grpc-service-name"]]){ + outbound.grpcSni = grpcOpts[["grpc-service-name"]]; + } + } + if(type(outbound.tls)!="string"){ if(outbound.tls) outbound.tls = "tls"; else outbound.tls = ""; diff --git a/main.aardio b/main.aardio index 28914ae..3e04f11 100644 --- a/main.aardio +++ b/main.aardio @@ -162,7 +162,7 @@ import win.ui; mainForm = win.form(text="WinXray";right=1019;bottom=679;bgcolor=15793151;border="none") mainForm.add( Promote={cls="plus";text="推荐";left=0;top=300;right=85;bottom=380;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(h=-13);iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF233';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=8}; -caption={cls="bkplus";text="WinXray.COM V4.2";left=25;top=9;right=685;bottom=27;align="left";color=6052956;dl=1;dt=1;font=LOGFONT(h=-14);z=6}; +caption={cls="bkplus";text="WinXray.COM V4.3";left=25;top=9;right=685;bottom=27;align="left";color=6052956;dl=1;dt=1;font=LOGFONT(h=-14);z=6}; custom={cls="custom";left=83;top=40;right=1022;bottom=679;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=3}; navBar={cls="bkplus";left=0;top=37;right=83;bottom=681;bgcolor=3442175;db=1;dl=1;dt=1;z=1}; navJsonConfig={cls="plus";text="配置";left=0;top=132;right=85;bottom=212;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(h=-13);iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF0F6';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=5}; diff --git a/release/WinXray.7z b/release/WinXray.7z index 3d77c68..6f14467 100644 Binary files a/release/WinXray.7z and b/release/WinXray.7z differ diff --git a/release/WinXray32.7z b/release/WinXray32.7z index 297e0e4..5f8290b 100644 Binary files a/release/WinXray32.7z and b/release/WinXray32.7z differ diff --git a/release/update/checksum.lzma b/release/update/checksum.lzma index d2ac8fe..73e2537 100644 Binary files a/release/update/checksum.lzma and b/release/update/checksum.lzma differ diff --git a/release/update/files/WinXray.exe.lzma b/release/update/files/WinXray.exe.lzma index a020830..be87912 100644 Binary files a/release/update/files/WinXray.exe.lzma and b/release/update/files/WinXray.exe.lzma differ diff --git a/release/update/version.txt b/release/update/version.txt index 2c1070c..64ef9f8 100644 --- a/release/update/version.txt +++ b/release/update/version.txt @@ -1,8 +1,8 @@ { - "description":"V4.2 修复文件拖拽解析节点后空白的BUG!", + "description":"V4.3 文件拖放现在支持了二维码图片的节点识别;传输现在添加了grpc!", "format":".lzma", "main":"\\WinXray.exe", "updater":"\\WinXray.exe", "url":"https://raw.githubusercontent.com/TheMRLL/winxray/main/release/update/", - "version":"4.2" + "version":"4.3" } \ No newline at end of file