mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-25 06:36:08 +03:00
update grpc settings
This commit is contained in:
parent
9923437691
commit
b82e857edd
@ -47,6 +47,7 @@ namespace ProxySuper.Core.Models.Projects
|
|||||||
VLESS_KCP_Port,
|
VLESS_KCP_Port,
|
||||||
VMESS_KCP_Port,
|
VMESS_KCP_Port,
|
||||||
ShadowSocksPort,
|
ShadowSocksPort,
|
||||||
|
VLESS_gRPC_Port,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,18 +94,6 @@ namespace ProxySuper.Core.Services
|
|||||||
caddyStr = caddyStr.Replace("##reverse_proxy##", "");
|
caddyStr = caddyStr.Replace("##reverse_proxy##", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parameters.Types.Contains(XrayType.VLESS_gRPC))
|
|
||||||
{
|
|
||||||
var grpcCaddyfile = File.ReadAllText(Path.Combine(CaddyFileDir, "grpc.caddyfile"));
|
|
||||||
grpcCaddyfile = grpcCaddyfile.Replace("##domain##", parameters.Domain);
|
|
||||||
grpcCaddyfile = grpcCaddyfile.Replace("##port##", parameters.VLESS_gRPC_Port.ToString());
|
|
||||||
grpcCaddyfile = grpcCaddyfile.Replace("##local_port##", VLESS_gRPC_Port.ToString());
|
|
||||||
grpcCaddyfile = grpcCaddyfile.Replace("##path##", parameters.VLESS_gRPC_ServiceName);
|
|
||||||
|
|
||||||
caddyStr += "\n";
|
|
||||||
caddyStr += grpcCaddyfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
return caddyStr;
|
return caddyStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +130,7 @@ namespace ProxySuper.Core.Services
|
|||||||
gRPCInBound.port = VLESS_gRPC_Port;
|
gRPCInBound.port = VLESS_gRPC_Port;
|
||||||
gRPCInBound.settings.clients[0].id = parameters.UUID;
|
gRPCInBound.settings.clients[0].id = parameters.UUID;
|
||||||
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
gRPCInBound.streamSettings.grpcSettings.serviceName = parameters.VLESS_gRPC_ServiceName;
|
||||||
|
gRPCInBound.streamSettings.tlsSettings.serverName = parameters.Domain;
|
||||||
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
|
xrayConfig.inbounds.Add(JToken.FromObject(gRPCInBound));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,9 +303,6 @@
|
|||||||
<None Include="Templates\xray\caddy\base.caddyfile">
|
<None Include="Templates\xray\caddy\base.caddyfile">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="Templates\xray\caddy\grpc.caddyfile">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Templates\xray\client\00_log\00_log.json">
|
<None Include="Templates\xray\client\00_log\00_log.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
##domain##:##port## {
|
|
||||||
@grpc {
|
|
||||||
protocol grpc
|
|
||||||
path ##path##
|
|
||||||
}
|
|
||||||
|
|
||||||
reverse_proxy @grpc h2c://127.0.0.1:##local_port##
|
|
||||||
root * /var/www
|
|
||||||
file_server
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"port": 2003,
|
"port": 2002,
|
||||||
"listen": "127.0.0.1",
|
"listen": "0.0.0.0",
|
||||||
"protocol": "vless",
|
"protocol": "vless",
|
||||||
"settings": {
|
"settings": {
|
||||||
"clients": [
|
"clients": [
|
||||||
@ -11,9 +11,22 @@
|
|||||||
"decryption": "none"
|
"decryption": "none"
|
||||||
},
|
},
|
||||||
"streamSettings": {
|
"streamSettings": {
|
||||||
"network": "grpc",
|
"network": "gun",
|
||||||
|
"security": "tls",
|
||||||
|
"tlsSettings": {
|
||||||
|
"serverName": "domain",
|
||||||
|
"alpn": [
|
||||||
|
"h2"
|
||||||
|
],
|
||||||
|
"certificates": [
|
||||||
|
{
|
||||||
|
"certificateFile": "/usr/local/etc/xray/ssl/xray_ssl.crt",
|
||||||
|
"keyFile": "/usr/local/etc/xray/ssl/xray_ssl.key"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"grpcSettings": {
|
"grpcSettings": {
|
||||||
"serviceName": ""
|
"serviceName": "service_name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,12 +51,12 @@
|
|||||||
<ctrl:VLESS_KCP_Control />
|
<ctrl:VLESS_KCP_Control />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
<!--<TabItem Width="200"
|
<TabItem Width="200"
|
||||||
Tag="{x:Static models:XrayType.VLESS_gRPC}"
|
Tag="{x:Static models:XrayType.VLESS_gRPC}"
|
||||||
IsEnabled="{Binding Checked_VLESS_gRPC}"
|
IsEnabled="{Binding Checked_VLESS_gRPC}"
|
||||||
Header="VLESS-gRPC">
|
Header="VLESS-gRPC">
|
||||||
<ctrl:VLESS_gRPC_Control />
|
<ctrl:VLESS_gRPC_Control />
|
||||||
</TabItem>-->
|
</TabItem>
|
||||||
|
|
||||||
<!--<TabItem Width="200" Height="40"
|
<!--<TabItem Width="200" Height="40"
|
||||||
Tag="{x:Static models:XrayType.VMESS_TCP}"
|
Tag="{x:Static models:XrayType.VMESS_TCP}"
|
||||||
|
Loading…
Reference in New Issue
Block a user