Skip to content

Commit

Permalink
V4.3 文件拖放现在支持了二维码图片的节点识别;传输现在添加了grpc!
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMRLL authored Oct 17, 2021
1 parent 50edbc2 commit 4019df0
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

WinXray V4.2 修复文件拖拽解析节点后空白的BUG!
WinXray V4.3 文件拖放现在支持了二维码图片的节点识别;传输现在添加了grpc!

导语:
Expand Down
Binary file added WinXray/WinXray.exe
Binary file not shown.
1 change: 1 addition & 0 deletions WinXray/xray-core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/XTLS/Xray-core/blob/main/LICENSE
19 changes: 19 additions & 0 deletions WinXray/xray-core/winXray-default-servers.json
Original file line number Diff line number Diff line change
@@ -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":"描述文本"
}
]
Binary file added WinXray/xray-core/xray.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion default.aproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="WinXray" libEmbed="true" icon="\forms\ico\app.ico" ui="win" output="WinXray.exe" CompanyName="WinXray" FileDescription="网络代理通用客户端" LegalCopyright="Copyright (C) WinXray" ProductName="WinXray" InternalName="WinXray" FileVersion="4.2" ProductVersion="4.2" publishDir="\WinXray" dstrip="false" local="false" ignored="false">
<project ver="10" name="WinXray" libEmbed="true" icon="\forms\ico\app.ico" ui="win" output="WinXray.exe" CompanyName="WinXray" FileDescription="网络代理通用客户端" LegalCopyright="Copyright (C) WinXray" ProductName="WinXray" InternalName="WinXray" FileVersion="4.3" ProductVersion="4.3" publishDir="\WinXray" dstrip="false" local="false" ignored="false">
<file name="main" path="main.aardio"/>
<folder name="窗体" path="forms" comment="" embed="true" local="false" ignored="false">
<folder name="ico" path="forms\ico" comment="forms\ico" local="false" embed="false" ignored="false">
Expand Down
17 changes: 9 additions & 8 deletions forms/main/outbound.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -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"){
Expand All @@ -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"){
Expand All @@ -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"){
Expand All @@ -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"){
Expand All @@ -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 {
Expand All @@ -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("请输入密码");
}
}
Expand Down Expand Up @@ -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"};
Expand Down
22 changes: 21 additions & 1 deletion forms/main/xray.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -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 ');
Expand All @@ -1050,7 +1070,7 @@ frmXray.onDropFiles = function(files){
}
}
}
frmXray.msgFrown('未能在文件中导入节点!');
//frmXray.msgFrown('未能在文件中导入节点!');
}

import win.imageList;
Expand Down
10 changes: 10 additions & 0 deletions lib/xray/core/configJson.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ write = function(jsonPath,outbound,sockPort,httpPort){
}
}
}
elseif( outbound.network == "grpc" ){
ob.streamSettings.grpcSettings = {
serviceName = outbound.grpcSni;
}
}

..table.assign(proxyOutboundInCore,ob);
}
Expand Down Expand Up @@ -301,6 +306,11 @@ write = function(jsonPath,outbound,sockPort,httpPort){
}
}
}
elseif( outbound.network == "grpc" ){
ob.streamSettings.grpcSettings = {
serviceName = outbound.grpcSni;
}
}

..table.assign(proxyOutboundInCore,ob);
}
Expand Down
8 changes: 8 additions & 0 deletions lib/xray/outbounds.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ validOutbound = function(outbound){
outbound.id = outbound.password;
outbound.password = null;
}

if(outbound.uuid){
outbound.id = outbound.uuid;
outbound.uuid = null;
Expand All @@ -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 = "";
Expand Down
2 changes: 1 addition & 1 deletion main.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Binary file modified release/WinXray.7z
Binary file not shown.
Binary file modified release/WinXray32.7z
Binary file not shown.
Binary file modified release/update/checksum.lzma
Binary file not shown.
Binary file modified release/update/files/WinXray.exe.lzma
Binary file not shown.
4 changes: 2 additions & 2 deletions release/update/version.txt
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 4019df0

Please sign in to comment.