1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2025-02-21 08:53:17 +03:00

修正模板错误

This commit is contained in:
ProxySU 2020-04-05 23:56:39 +08:00
parent fb904ed824
commit 873701e4cb
6 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ bld/
# Visual Studo 2015 cache/options directory # Visual Studo 2015 cache/options directory
.vs/ .vs/
.git/
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/

View File

@ -470,7 +470,7 @@ namespace ProxySU
long timeStampVPS = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString()); long timeStampVPS = Convert.ToInt64(client.RunCommand("date +%s").Result.ToString());
//MessageBox.Show(timesStampVPS.ToString()); //MessageBox.Show(timesStampVPS.ToString());
//获取本地时间戳 //获取本地时间戳
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
long timeStampLocal = Convert.ToInt64(ts.TotalSeconds); long timeStampLocal = Convert.ToInt64(ts.TotalSeconds);
if (Math.Abs(timeStampLocal - timeStampVPS) >= 90) if (Math.Abs(timeStampLocal - timeStampVPS) >= 90)
{ {
@ -569,7 +569,11 @@ namespace ProxySU
// do stuff // do stuff
//MessageBox.Show(clientJson.ToString()); //MessageBox.Show(clientJson.ToString());
//clientJson["inbounds"][0]["settings"]["vnext"][0]["address"] = ReceiveConfigurationParameters[4]; //clientJson["inbounds"][0]["settings"]["vnext"][0]["address"] = ReceiveConfigurationParameters[4];
serverJson["inbounds"][0]["port"] = ReceiveConfigurationParameters[1]; if (serverConfig.Contains("WebSocketTLSWeb") == false)
{
serverJson["inbounds"][0]["port"] = ReceiveConfigurationParameters[1];
}
serverJson["inbounds"][0]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; serverJson["inbounds"][0]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2];
if (serverJson.Property("path") != null) if (serverJson.Property("path") != null)
{ {
@ -746,6 +750,7 @@ namespace ProxySU
else else
{ {
MessageBox.Show("未知错误"); MessageBox.Show("未知错误");
MessageBox.Show(ex1.Message);
} }
currentStatus = "主机登录失败"; currentStatus = "主机登录失败";
textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus); textBlockName.Dispatcher.BeginInvoke(updateAction, textBlockName, progressBar, currentStatus);
@ -764,7 +769,9 @@ namespace ProxySU
sftpClient.Connect(); sftpClient.Connect();
//MessageBox.Show("sftp信息1" + sftpClient.ConnectionInfo.ServerVersion.ToString()); //MessageBox.Show("sftp信息1" + sftpClient.ConnectionInfo.ServerVersion.ToString());
//sftpClient.UploadFile(File.OpenRead("TemplateConfg\tcp_server_config.json"), "/etc/v2ray/config.json", true); //sftpClient.UploadFile(File.OpenRead("TemplateConfg\tcp_server_config.json"), "/etc/v2ray/config.json", true);
sftpClient.UploadFile(File.OpenRead(uploadConfig), upLoadPath, true); FileStream openUploadConfigFile = File.OpenRead(uploadConfig);
sftpClient.UploadFile(openUploadConfigFile, upLoadPath, true);
openUploadConfigFile.Close();
//MessageBox.Show("sftp信息" + sftpClient.ConnectionInfo.ServerVersion.ToString()); //MessageBox.Show("sftp信息" + sftpClient.ConnectionInfo.ServerVersion.ToString());
sftpClient.Disconnect(); sftpClient.Disconnect();
} }
@ -785,8 +792,9 @@ namespace ProxySU
{ {
sftpClient.Connect(); sftpClient.Connect();
//MessageBox.Show("sftp信息1" + sftpClient.ConnectionInfo.ServerVersion.ToString()); //MessageBox.Show("sftp信息1" + sftpClient.ConnectionInfo.ServerVersion.ToString());
FileStream createDownloadConfig = File.Open(downloadConfig, FileMode.Create);
sftpClient.DownloadFile(downloadPath, File.Open(downloadConfig,FileMode.Create)); sftpClient.DownloadFile(downloadPath, createDownloadConfig);
createDownloadConfig.Close();
//MessageBox.Show("sftp信息" + sftpClient.ConnectionInfo.ServerVersion.ToString()); //MessageBox.Show("sftp信息" + sftpClient.ConnectionInfo.ServerVersion.ToString());
sftpClient.Disconnect(); sftpClient.Disconnect();
} }

View File

@ -7,7 +7,7 @@
"settings": { "settings": {
"clients": [ "clients": [
{ {
"id": null, "id": "",
"alterId": 64 "alterId": 64
} }
] ]
@ -15,7 +15,7 @@
"streamSettings": { "streamSettings": {
"network": "ws", "network": "ws",
"wsSettings": { "wsSettings": {
"path": null "path": ""
} }
} }
} }

View File

@ -6,7 +6,7 @@
"settings": { "settings": {
"clients": [ "clients": [
{ {
"id": null, "id": "",
"alterId": 64 "alterId": 64
} }
] ]
@ -18,7 +18,7 @@
"downlinkCapacity": 100, "downlinkCapacity": 100,
"congestion": true, "congestion": true,
"header": { "header": {
"type": null "type": ""
} }
} }
} }

View File

@ -1,12 +1,12 @@
{ {
"inbounds": [ "inbounds": [
{ {
"port": ,null "port": null,
"protocol": "vmess", "protocol": "vmess",
"settings": { "settings": {
"clients": [ "clients": [
{ {
"id": null, "id": "",
"alterId": 64 "alterId": 64
} }
] ]

View File

@ -7,7 +7,7 @@
"settings": { "settings": {
"clients": [ "clients": [
{ {
"id": null, "id": "",
"alterId": 64 "alterId": 64
} }
] ]