统计切换为grpc

pull/44/head
CGQAQ 2019-08-27 15:51:15 +08:00
parent 52b31fba1e
commit d555081820
8 changed files with 1303 additions and 1226 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@
/v2rayN/.vs/v2rayN/DesignTimeBuild /v2rayN/.vs/v2rayN/DesignTimeBuild
/v2rayN/v2rayN/bin/Release /v2rayN/v2rayN/bin/Release
/v2rayN/v2rayN/obj/Release /v2rayN/v2rayN/obj/Release
/v2rayN/packages
.vs/ProjectSettings.json .vs/ProjectSettings.json
.vs/slnx.sqlite .vs/slnx.sqlite
.vs/VSWorkspaceState.json .vs/VSWorkspaceState.json

View File

@ -136,19 +136,17 @@
// //
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
resources.ApplyResources(this.splitContainer1.Panel1, "splitContainer1.Panel1");
this.splitContainer1.Panel1.Controls.Add(this.lvServers); this.splitContainer1.Panel1.Controls.Add(this.lvServers);
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
resources.ApplyResources(this.splitContainer1.Panel2, "splitContainer1.Panel2");
this.splitContainer1.Panel2.Controls.Add(this.qrCodeControl); this.splitContainer1.Panel2.Controls.Add(this.qrCodeControl);
this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer1_SplitterMoved); this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer1_SplitterMoved);
// //
// lvServers // lvServers
// //
resources.ApplyResources(this.lvServers, "lvServers");
this.lvServers.ContextMenuStrip = this.cmsLv; this.lvServers.ContextMenuStrip = this.cmsLv;
resources.ApplyResources(this.lvServers, "lvServers");
this.lvServers.FullRowSelect = true; this.lvServers.FullRowSelect = true;
this.lvServers.GridLines = true; this.lvServers.GridLines = true;
this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
@ -165,7 +163,6 @@
// //
// cmsLv // cmsLv
// //
resources.ApplyResources(this.cmsLv, "cmsLv");
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuAddVmessServer, this.menuAddVmessServer,
@ -195,158 +192,159 @@
this.menuExport2SubContent}); this.menuExport2SubContent});
this.cmsLv.Name = "cmsLv"; this.cmsLv.Name = "cmsLv";
this.cmsLv.OwnerItem = this.tsbServer; this.cmsLv.OwnerItem = this.tsbServer;
resources.ApplyResources(this.cmsLv, "cmsLv");
// //
// menuAddVmessServer // menuAddVmessServer
// //
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
this.menuAddVmessServer.Name = "menuAddVmessServer"; this.menuAddVmessServer.Name = "menuAddVmessServer";
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
this.menuAddVmessServer.Click += new System.EventHandler(this.menuAddVmessServer_Click); this.menuAddVmessServer.Click += new System.EventHandler(this.menuAddVmessServer_Click);
// //
// menuAddShadowsocksServer // menuAddShadowsocksServer
// //
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer"; this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer";
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
this.menuAddShadowsocksServer.Click += new System.EventHandler(this.menuAddShadowsocksServer_Click); this.menuAddShadowsocksServer.Click += new System.EventHandler(this.menuAddShadowsocksServer_Click);
// //
// menuAddSocksServer // menuAddSocksServer
// //
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
this.menuAddSocksServer.Name = "menuAddSocksServer"; this.menuAddSocksServer.Name = "menuAddSocksServer";
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
this.menuAddSocksServer.Click += new System.EventHandler(this.menuAddSocksServer_Click); this.menuAddSocksServer.Click += new System.EventHandler(this.menuAddSocksServer_Click);
// //
// menuAddCustomServer // menuAddCustomServer
// //
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
this.menuAddCustomServer.Name = "menuAddCustomServer"; this.menuAddCustomServer.Name = "menuAddCustomServer";
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
this.menuAddCustomServer.Click += new System.EventHandler(this.menuAddCustomServer_Click); this.menuAddCustomServer.Click += new System.EventHandler(this.menuAddCustomServer_Click);
// //
// menuAddServers // menuAddServers
// //
resources.ApplyResources(this.menuAddServers, "menuAddServers");
this.menuAddServers.Name = "menuAddServers"; this.menuAddServers.Name = "menuAddServers";
resources.ApplyResources(this.menuAddServers, "menuAddServers");
this.menuAddServers.Click += new System.EventHandler(this.menuAddServers_Click); this.menuAddServers.Click += new System.EventHandler(this.menuAddServers_Click);
// //
// menuScanScreen // menuScanScreen
// //
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
this.menuScanScreen.Name = "menuScanScreen"; this.menuScanScreen.Name = "menuScanScreen";
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
this.menuScanScreen.Click += new System.EventHandler(this.menuScanScreen_Click); this.menuScanScreen.Click += new System.EventHandler(this.menuScanScreen_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
// //
// menuRemoveServer // menuRemoveServer
// //
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Name = "menuRemoveServer"; this.menuRemoveServer.Name = "menuRemoveServer";
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click); this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click);
// //
// menuRemoveDuplicateServer // menuRemoveDuplicateServer
// //
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer"; this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click); this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click);
// //
// menuCopyServer // menuCopyServer
// //
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
this.menuCopyServer.Name = "menuCopyServer"; this.menuCopyServer.Name = "menuCopyServer";
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
this.menuCopyServer.Click += new System.EventHandler(this.menuCopyServer_Click); this.menuCopyServer.Click += new System.EventHandler(this.menuCopyServer_Click);
// //
// menuSetDefaultServer // menuSetDefaultServer
// //
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
this.menuSetDefaultServer.Name = "menuSetDefaultServer"; this.menuSetDefaultServer.Name = "menuSetDefaultServer";
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click); this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
// //
// menuMoveTop // menuMoveTop
// //
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Name = "menuMoveTop"; this.menuMoveTop.Name = "menuMoveTop";
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click); this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
// //
// menuMoveUp // menuMoveUp
// //
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Name = "menuMoveUp"; this.menuMoveUp.Name = "menuMoveUp";
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click); this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
// //
// menuMoveDown // menuMoveDown
// //
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Name = "menuMoveDown"; this.menuMoveDown.Name = "menuMoveDown";
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click); this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
// //
// menuMoveBottom // menuMoveBottom
// //
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Name = "menuMoveBottom"; this.menuMoveBottom.Name = "menuMoveBottom";
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click); this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
// //
// menuSelectAll // menuSelectAll
// //
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Name = "menuSelectAll"; this.menuSelectAll.Name = "menuSelectAll";
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click); this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
// //
// toolStripSeparator9 // toolStripSeparator9
// //
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Name = "toolStripSeparator9";
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
// //
// menuPingServer // menuPingServer
// //
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Name = "menuPingServer"; this.menuPingServer.Name = "menuPingServer";
resources.ApplyResources(this.menuPingServer, "menuPingServer");
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click); this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
// //
// menuSpeedServer // menuSpeedServer
// //
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Name = "menuSpeedServer"; this.menuSpeedServer.Name = "menuSpeedServer";
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click); this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
// //
// toolStripSeparator6 // toolStripSeparator6
// //
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Name = "toolStripSeparator6";
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
// //
// menuExport2ClientConfig // menuExport2ClientConfig
// //
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
this.menuExport2ClientConfig.Name = "menuExport2ClientConfig"; this.menuExport2ClientConfig.Name = "menuExport2ClientConfig";
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
this.menuExport2ClientConfig.Click += new System.EventHandler(this.menuExport2ClientConfig_Click); this.menuExport2ClientConfig.Click += new System.EventHandler(this.menuExport2ClientConfig_Click);
// //
// menuExport2ServerConfig // menuExport2ServerConfig
// //
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
this.menuExport2ServerConfig.Name = "menuExport2ServerConfig"; this.menuExport2ServerConfig.Name = "menuExport2ServerConfig";
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
this.menuExport2ServerConfig.Click += new System.EventHandler(this.menuExport2ServerConfig_Click); this.menuExport2ServerConfig.Click += new System.EventHandler(this.menuExport2ServerConfig_Click);
// //
// menuExport2ShareUrl // menuExport2ShareUrl
// //
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
this.menuExport2ShareUrl.Name = "menuExport2ShareUrl"; this.menuExport2ShareUrl.Name = "menuExport2ShareUrl";
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
this.menuExport2ShareUrl.Click += new System.EventHandler(this.menuExport2ShareUrl_Click); this.menuExport2ShareUrl.Click += new System.EventHandler(this.menuExport2ShareUrl_Click);
// //
// menuExport2SubContent // menuExport2SubContent
// //
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Name = "menuExport2SubContent"; this.menuExport2SubContent.Name = "menuExport2SubContent";
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click); this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
// //
// tsbServer // tsbServer
// //
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.DropDown = this.cmsLv; this.tsbServer.DropDown = this.cmsLv;
this.tsbServer.Image = global::v2rayN.Properties.Resources.server; this.tsbServer.Image = global::v2rayN.Properties.Resources.server;
resources.ApplyResources(this.tsbServer, "tsbServer");
this.tsbServer.Name = "tsbServer"; this.tsbServer.Name = "tsbServer";
// //
// qrCodeControl // qrCodeControl
@ -356,14 +354,14 @@
// //
// notifyMain // notifyMain
// //
resources.ApplyResources(this.notifyMain, "notifyMain");
this.notifyMain.ContextMenuStrip = this.cmsMain; this.notifyMain.ContextMenuStrip = this.cmsMain;
resources.ApplyResources(this.notifyMain, "notifyMain");
this.notifyMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyMain_MouseClick); this.notifyMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyMain_MouseClick);
// //
// cmsMain // cmsMain
// //
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20); this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
resources.ApplyResources(this.cmsMain, "cmsMain");
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSysAgentEnabled, this.menuSysAgentEnabled,
this.menuSysAgentMode, this.menuSysAgentMode,
@ -380,76 +378,76 @@
// //
// menuSysAgentEnabled // menuSysAgentEnabled
// //
resources.ApplyResources(this.menuSysAgentEnabled, "menuSysAgentEnabled");
this.menuSysAgentEnabled.Name = "menuSysAgentEnabled"; this.menuSysAgentEnabled.Name = "menuSysAgentEnabled";
resources.ApplyResources(this.menuSysAgentEnabled, "menuSysAgentEnabled");
this.menuSysAgentEnabled.Click += new System.EventHandler(this.menuSysAgentEnabled_Click); this.menuSysAgentEnabled.Click += new System.EventHandler(this.menuSysAgentEnabled_Click);
// //
// menuSysAgentMode // menuSysAgentMode
// //
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuGlobal, this.menuGlobal,
this.menuGlobalPAC, this.menuGlobalPAC,
this.menuKeep, this.menuKeep,
this.menuKeepPAC}); this.menuKeepPAC});
this.menuSysAgentMode.Name = "menuSysAgentMode"; this.menuSysAgentMode.Name = "menuSysAgentMode";
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
// //
// menuGlobal // menuGlobal
// //
resources.ApplyResources(this.menuGlobal, "menuGlobal");
this.menuGlobal.Name = "menuGlobal"; this.menuGlobal.Name = "menuGlobal";
resources.ApplyResources(this.menuGlobal, "menuGlobal");
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click); this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
// //
// menuGlobalPAC // menuGlobalPAC
// //
resources.ApplyResources(this.menuGlobalPAC, "menuGlobalPAC");
this.menuGlobalPAC.Name = "menuGlobalPAC"; this.menuGlobalPAC.Name = "menuGlobalPAC";
resources.ApplyResources(this.menuGlobalPAC, "menuGlobalPAC");
this.menuGlobalPAC.Click += new System.EventHandler(this.menuGlobalPAC_Click); this.menuGlobalPAC.Click += new System.EventHandler(this.menuGlobalPAC_Click);
// //
// menuKeep // menuKeep
// //
resources.ApplyResources(this.menuKeep, "menuKeep");
this.menuKeep.Name = "menuKeep"; this.menuKeep.Name = "menuKeep";
resources.ApplyResources(this.menuKeep, "menuKeep");
this.menuKeep.Click += new System.EventHandler(this.menuKeep_Click); this.menuKeep.Click += new System.EventHandler(this.menuKeep_Click);
// //
// menuKeepPAC // menuKeepPAC
// //
resources.ApplyResources(this.menuKeepPAC, "menuKeepPAC");
this.menuKeepPAC.Name = "menuKeepPAC"; this.menuKeepPAC.Name = "menuKeepPAC";
resources.ApplyResources(this.menuKeepPAC, "menuKeepPAC");
this.menuKeepPAC.Click += new System.EventHandler(this.menuKeepPAC_Click); this.menuKeepPAC.Click += new System.EventHandler(this.menuKeepPAC_Click);
// //
// menuServers // menuServers
// //
resources.ApplyResources(this.menuServers, "menuServers");
this.menuServers.Name = "menuServers"; this.menuServers.Name = "menuServers";
resources.ApplyResources(this.menuServers, "menuServers");
// //
// menuAddServers2 // menuAddServers2
// //
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
this.menuAddServers2.Name = "menuAddServers2"; this.menuAddServers2.Name = "menuAddServers2";
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
this.menuAddServers2.Click += new System.EventHandler(this.menuAddServers_Click); this.menuAddServers2.Click += new System.EventHandler(this.menuAddServers_Click);
// //
// menuScanScreen2 // menuScanScreen2
// //
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
this.menuScanScreen2.Name = "menuScanScreen2"; this.menuScanScreen2.Name = "menuScanScreen2";
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click); this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click);
// //
// menuCopyPACUrl // menuCopyPACUrl
// //
resources.ApplyResources(this.menuCopyPACUrl, "menuCopyPACUrl");
this.menuCopyPACUrl.Name = "menuCopyPACUrl"; this.menuCopyPACUrl.Name = "menuCopyPACUrl";
resources.ApplyResources(this.menuCopyPACUrl, "menuCopyPACUrl");
this.menuCopyPACUrl.Click += new System.EventHandler(this.menuCopyPACUrl_Click); this.menuCopyPACUrl.Click += new System.EventHandler(this.menuCopyPACUrl_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
// //
// menuExit // menuExit
// //
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Name = "menuExit"; this.menuExit.Name = "menuExit";
resources.ApplyResources(this.menuExit, "menuExit");
this.menuExit.Click += new System.EventHandler(this.menuExit_Click); this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
// //
// bgwPing // bgwPing
@ -466,31 +464,30 @@
// //
// groupBox1 // groupBox1
// //
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.splitContainer1); this.groupBox1.Controls.Add(this.splitContainer1);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// groupBox2 // groupBox2
// //
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.txtMsgBox); this.groupBox2.Controls.Add(this.txtMsgBox);
this.groupBox2.Controls.Add(this.ssMain); this.groupBox2.Controls.Add(this.ssMain);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
// //
// txtMsgBox // txtMsgBox
// //
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52))))); this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228))))); this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox"; this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true; this.txtMsgBox.ReadOnly = true;
// //
// ssMain // ssMain
// //
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolSslSocksPortLab, this.toolSslSocksPortLab,
this.toolSslSocksPort, this.toolSslSocksPort,
@ -503,66 +500,68 @@
this.toolSslBlank3, this.toolSslBlank3,
this.toolSslServerSpeed, this.toolSslServerSpeed,
this.toolSslBlank4}); this.toolSslBlank4});
resources.ApplyResources(this.ssMain, "ssMain");
this.ssMain.Name = "ssMain"; this.ssMain.Name = "ssMain";
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked); this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
// //
// toolSslSocksPortLab // toolSslSocksPortLab
// //
resources.ApplyResources(this.toolSslSocksPortLab, "toolSslSocksPortLab");
this.toolSslSocksPortLab.Name = "toolSslSocksPortLab"; this.toolSslSocksPortLab.Name = "toolSslSocksPortLab";
resources.ApplyResources(this.toolSslSocksPortLab, "toolSslSocksPortLab");
// //
// toolSslSocksPort // toolSslSocksPort
// //
resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
this.toolSslSocksPort.Name = "toolSslSocksPort"; this.toolSslSocksPort.Name = "toolSslSocksPort";
resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
// //
// toolSslBlank1 // toolSslBlank1
// //
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Name = "toolSslBlank1"; this.toolSslBlank1.Name = "toolSslBlank1";
resources.ApplyResources(this.toolSslBlank1, "toolSslBlank1");
this.toolSslBlank1.Spring = true; this.toolSslBlank1.Spring = true;
// //
// toolSslHttpPortLab // toolSslHttpPortLab
// //
resources.ApplyResources(this.toolSslHttpPortLab, "toolSslHttpPortLab");
this.toolSslHttpPortLab.Name = "toolSslHttpPortLab"; this.toolSslHttpPortLab.Name = "toolSslHttpPortLab";
resources.ApplyResources(this.toolSslHttpPortLab, "toolSslHttpPortLab");
// //
// toolSslHttpPort // toolSslHttpPort
// //
resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
this.toolSslHttpPort.Name = "toolSslHttpPort"; this.toolSslHttpPort.Name = "toolSslHttpPort";
resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
// //
// toolSslBlank2 // toolSslBlank2
// //
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Name = "toolSslBlank2"; this.toolSslBlank2.Name = "toolSslBlank2";
resources.ApplyResources(this.toolSslBlank2, "toolSslBlank2");
this.toolSslBlank2.Spring = true; this.toolSslBlank2.Spring = true;
// //
// toolSslPacPortLab // toolSslPacPortLab
// //
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
this.toolSslPacPortLab.Name = "toolSslPacPortLab"; this.toolSslPacPortLab.Name = "toolSslPacPortLab";
resources.ApplyResources(this.toolSslPacPortLab, "toolSslPacPortLab");
// //
// toolSslPacPort // toolSslPacPort
// //
resources.ApplyResources(this.toolSslPacPort, "toolSslPacPort");
this.toolSslPacPort.Name = "toolSslPacPort"; this.toolSslPacPort.Name = "toolSslPacPort";
resources.ApplyResources(this.toolSslPacPort, "toolSslPacPort");
// //
// toolSslBlank3 // toolSslBlank3
// //
resources.ApplyResources(this.toolSslBlank3, "toolSslBlank3");
this.toolSslBlank3.Name = "toolSslBlank3"; this.toolSslBlank3.Name = "toolSslBlank3";
resources.ApplyResources(this.toolSslBlank3, "toolSslBlank3");
this.toolSslBlank3.Spring = true; this.toolSslBlank3.Spring = true;
// //
// toolSslServerSpeed // toolSslServerSpeed
// //
resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed"); resources.ApplyResources(this.toolSslServerSpeed, "toolSslServerSpeed");
this.toolSslServerSpeed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolSslServerSpeed.Name = "toolSslServerSpeed"; this.toolSslServerSpeed.Name = "toolSslServerSpeed";
// //
// toolSslBlank4 // toolSslBlank4
// //
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
this.toolSslBlank4.Name = "toolSslBlank4"; this.toolSslBlank4.Name = "toolSslBlank4";
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
// //
// panel1 // panel1
// //
@ -571,7 +570,6 @@
// //
// tsMain // tsMain
// //
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.ImageScalingSize = new System.Drawing.Size(32, 32); this.tsMain.ImageScalingSize = new System.Drawing.Size(32, 32);
this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbServer, this.tsbServer,
@ -588,50 +586,51 @@
this.tsbPromotion, this.tsbPromotion,
this.toolStripSeparator11, this.toolStripSeparator11,
this.tsbClose}); this.tsbClose});
resources.ApplyResources(this.tsMain, "tsMain");
this.tsMain.Name = "tsMain"; this.tsMain.Name = "tsMain";
// //
// toolStripSeparator4 // toolStripSeparator4
// //
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
// //
// tsbSub // tsbSub
// //
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSubSetting, this.tsbSubSetting,
this.tsbSubUpdate}); this.tsbSubUpdate});
this.tsbSub.Image = global::v2rayN.Properties.Resources.sub; this.tsbSub.Image = global::v2rayN.Properties.Resources.sub;
resources.ApplyResources(this.tsbSub, "tsbSub");
this.tsbSub.Name = "tsbSub"; this.tsbSub.Name = "tsbSub";
// //
// tsbSubSetting // tsbSubSetting
// //
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
this.tsbSubSetting.Name = "tsbSubSetting"; this.tsbSubSetting.Name = "tsbSubSetting";
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
this.tsbSubSetting.Click += new System.EventHandler(this.tsbSubSetting_Click); this.tsbSubSetting.Click += new System.EventHandler(this.tsbSubSetting_Click);
// //
// tsbSubUpdate // tsbSubUpdate
// //
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
this.tsbSubUpdate.Name = "tsbSubUpdate"; this.tsbSubUpdate.Name = "tsbSubUpdate";
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
this.tsbSubUpdate.Click += new System.EventHandler(this.tsbSubUpdate_Click); this.tsbSubUpdate.Click += new System.EventHandler(this.tsbSubUpdate_Click);
// //
// toolStripSeparator8 // toolStripSeparator8
// //
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Name = "toolStripSeparator8";
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
// //
// tsbOptionSetting // tsbOptionSetting
// //
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Image = global::v2rayN.Properties.Resources.option; this.tsbOptionSetting.Image = global::v2rayN.Properties.Resources.option;
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
this.tsbOptionSetting.Name = "tsbOptionSetting"; this.tsbOptionSetting.Name = "tsbOptionSetting";
this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click); this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click);
// //
// toolStripSeparator5 // toolStripSeparator5
// //
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Name = "toolStripSeparator5";
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
// //
// tsbReload // tsbReload
// //
@ -641,95 +640,95 @@
// //
// toolStripSeparator7 // toolStripSeparator7
// //
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
// //
// tsbCheckUpdate // tsbCheckUpdate
// //
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCheckUpdateN, this.tsbCheckUpdateN,
this.tsbCheckUpdateCore, this.tsbCheckUpdateCore,
this.tsbCheckUpdatePACList, this.tsbCheckUpdatePACList,
this.tsbCheckClearPACList}); this.tsbCheckClearPACList});
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate; this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
this.tsbCheckUpdate.Name = "tsbCheckUpdate"; this.tsbCheckUpdate.Name = "tsbCheckUpdate";
// //
// tsbCheckUpdateN // tsbCheckUpdateN
// //
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
this.tsbCheckUpdateN.Name = "tsbCheckUpdateN"; this.tsbCheckUpdateN.Name = "tsbCheckUpdateN";
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
this.tsbCheckUpdateN.Click += new System.EventHandler(this.tsbCheckUpdateN_Click); this.tsbCheckUpdateN.Click += new System.EventHandler(this.tsbCheckUpdateN_Click);
// //
// tsbCheckUpdateCore // tsbCheckUpdateCore
// //
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore"; this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click); this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
// //
// tsbCheckUpdatePACList // tsbCheckUpdatePACList
// //
resources.ApplyResources(this.tsbCheckUpdatePACList, "tsbCheckUpdatePACList");
this.tsbCheckUpdatePACList.Name = "tsbCheckUpdatePACList"; this.tsbCheckUpdatePACList.Name = "tsbCheckUpdatePACList";
resources.ApplyResources(this.tsbCheckUpdatePACList, "tsbCheckUpdatePACList");
this.tsbCheckUpdatePACList.Click += new System.EventHandler(this.tsbCheckUpdatePACList_Click); this.tsbCheckUpdatePACList.Click += new System.EventHandler(this.tsbCheckUpdatePACList_Click);
// //
// tsbCheckClearPACList // tsbCheckClearPACList
// //
resources.ApplyResources(this.tsbCheckClearPACList, "tsbCheckClearPACList");
this.tsbCheckClearPACList.Name = "tsbCheckClearPACList"; this.tsbCheckClearPACList.Name = "tsbCheckClearPACList";
resources.ApplyResources(this.tsbCheckClearPACList, "tsbCheckClearPACList");
this.tsbCheckClearPACList.Click += new System.EventHandler(this.tsbCheckClearPACList_Click); this.tsbCheckClearPACList.Click += new System.EventHandler(this.tsbCheckClearPACList_Click);
// //
// toolStripSeparator10 // toolStripSeparator10
// //
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
this.toolStripSeparator10.Name = "toolStripSeparator10"; this.toolStripSeparator10.Name = "toolStripSeparator10";
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
// //
// tsbHelp // tsbHelp
// //
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsbHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbAbout, this.tsbAbout,
this.toolStripSeparator12, this.toolStripSeparator12,
this.tsbLanguageDef, this.tsbLanguageDef,
this.tsbLanguageZhHans}); this.tsbLanguageZhHans});
this.tsbHelp.Image = global::v2rayN.Properties.Resources.help; this.tsbHelp.Image = global::v2rayN.Properties.Resources.help;
resources.ApplyResources(this.tsbHelp, "tsbHelp");
this.tsbHelp.Name = "tsbHelp"; this.tsbHelp.Name = "tsbHelp";
// //
// tsbAbout // tsbAbout
// //
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Name = "tsbAbout"; this.tsbAbout.Name = "tsbAbout";
resources.ApplyResources(this.tsbAbout, "tsbAbout");
this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click); this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click);
// //
// toolStripSeparator12 // toolStripSeparator12
// //
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
this.toolStripSeparator12.Name = "toolStripSeparator12"; this.toolStripSeparator12.Name = "toolStripSeparator12";
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
// //
// tsbLanguageDef // tsbLanguageDef
// //
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
this.tsbLanguageDef.Name = "tsbLanguageDef"; this.tsbLanguageDef.Name = "tsbLanguageDef";
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
this.tsbLanguageDef.Click += new System.EventHandler(this.tsbLanguageDef_Click); this.tsbLanguageDef.Click += new System.EventHandler(this.tsbLanguageDef_Click);
// //
// tsbLanguageZhHans // tsbLanguageZhHans
// //
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
this.tsbLanguageZhHans.Name = "tsbLanguageZhHans"; this.tsbLanguageZhHans.Name = "tsbLanguageZhHans";
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
this.tsbLanguageZhHans.Click += new System.EventHandler(this.tsbLanguageZhHans_Click); this.tsbLanguageZhHans.Click += new System.EventHandler(this.tsbLanguageZhHans_Click);
// //
// tsbPromotion // tsbPromotion
// //
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.ForeColor = System.Drawing.Color.Black; this.tsbPromotion.ForeColor = System.Drawing.Color.Black;
this.tsbPromotion.Image = global::v2rayN.Properties.Resources.promotion; this.tsbPromotion.Image = global::v2rayN.Properties.Resources.promotion;
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
this.tsbPromotion.Name = "tsbPromotion"; this.tsbPromotion.Name = "tsbPromotion";
this.tsbPromotion.Click += new System.EventHandler(this.tsbPromotion_Click); this.tsbPromotion.Click += new System.EventHandler(this.tsbPromotion_Click);
// //
// toolStripSeparator11 // toolStripSeparator11
// //
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
this.toolStripSeparator11.Name = "toolStripSeparator11"; this.toolStripSeparator11.Name = "toolStripSeparator11";
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
// //
// tsbClose // tsbClose
// //

File diff suppressed because it is too large Load Diff

View File

@ -395,13 +395,13 @@
</data> </data>
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd wwAADsMBx2+oZAAAATdJREFUWEftloENAiEMRW8ER3AEN9ANdARHcAPdwBF0A91AN9INtC+5JvUCJwWM
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X mvCTFw3QUiiU65qa/lUTYT6Ato9rJZyERwT6GFNdU+EihCYNwVhsqmgm3AR1fheOAitd9PCfNvp0HDbY
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY FolV2MmZZCzX9J0FG0TRTlwFdbahIVE7Qe1IR5bYVnXCyr2yO5F1MNUBec25YtjomcCXSxhr9DmrV2Gr
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3 flyL4GSrYcm9tmnEZ7JsAC7DgWr5ydbXA8hOAcVjG8FTD6ocQgvXKrW8MqFWUfc1DAXgmRwVFaJQAHsh
NQwF4JkcFRWiUAB7IVW2FFPO3YqlgPd+LJf02e8Fdi3rMdIAcLDuf9UpeT0IS0G/hvhPm305vSl7EQFY VbYUU87diqWA934sl/TZ7wV2Lesx0gBwsO5/1Sl5PQhLQb+G+E+bfTm9KXsRAVgHrMK+jO9gbNEzzMSh
B6zCvozvYGzRM8zEoeg5TPZwDaGvpHQni1yzSxbXPW9q+hF13ROHuJnQcjbhtQAAAABJRU5ErkJggg== 6DlM9nANoa+kdCeLXLNLFtc9b2r6EXXdE4e4mdByNuG1AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing"> <data name="tsbReload.Size" type="System.Drawing.Size, System.Drawing">
@ -457,12 +457,15 @@
</data> </data>
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/ wwAADsMBx2+oZAAAADJJREFUWEftzrENACAIRUFGdVMdTZkAG4zFXfI68kMAAD8ap9lUbpfyaDV19QAA
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg== 8FDEBl3RImu5VcdbAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="tsbClose.Text" xml:space="preserve"> <data name="tsbClose.Text" xml:space="preserve">
<value> 关闭 </value> <value> 关闭 </value>
</data> </data>
<data name="toolSslServerSpeed.Text" xml:space="preserve">
<value>网速显示未启用</value>
</data>
</root> </root>

View File

@ -5,18 +5,20 @@ using System.IO;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using v2rayN.Mode; using v2rayN.Mode;
using v2rayN.Protos.Statistics;
using Grpc.Core;
namespace v2rayN.Handler namespace v2rayN.Handler
{ {
class StatisticsHandler class StatisticsHandler
{ {
private Config config_; private Mode.Config config_;
private const string cliName_ = "v2ctl.exe";
private string args_ = "";
private Process connector_;
private Channel channel_;
private StatsService.StatsServiceClient client_;
private Thread workThread_; private Thread workThread_;
Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> updateFunc_; Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> updateFunc_;
@ -44,7 +46,7 @@ namespace v2rayN.Handler
private bool exitFlag_; // true to close workThread_ private bool exitFlag_; // true to close workThread_
public StatisticsHandler(Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update) public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
{ {
config_ = config; config_ = config;
enabled_ = config.enableStatistics; enabled_ = config.enableStatistics;
@ -63,40 +65,23 @@ namespace v2rayN.Handler
loadFromFile(); loadFromFile();
var fullPath = Utils.GetPath(cliName_); grpcInit();
if (!File.Exists(fullPath))
{
connector_ = null;
return;
}
// .\v2ctl.exe api --server="127.0.0.1:port" StatsService.QueryStats "reset:true"
args_ = string.Format("api --server=\"127.0.0.1:{0}\" StatsService.QueryStats \"reset:true\"", Global.InboundAPIPort);
connector_ = new Process();
connector_.StartInfo.FileName = fullPath;
connector_.StartInfo.Arguments = args_;
connector_.StartInfo.RedirectStandardOutput = true;
connector_.StartInfo.UseShellExecute = false;
connector_.StartInfo.CreateNoWindow = true;
workThread_ = new Thread(new ThreadStart(run)); workThread_ = new Thread(new ThreadStart(run));
workThread_.Start(); workThread_.Start();
} }
private void grpcInit ()
{
channel_ = new Channel($"127.0.0.1:{Global.InboundAPIPort}", ChannelCredentials.Insecure);
channel_.ConnectAsync();
client_ = new StatsService.StatsServiceClient(channel_);
}
public void Close() public void Close()
{
try
{ {
exitFlag_ = true; exitFlag_ = true;
if (!connector_.HasExited) channel_.ShutdownAsync();
{
connector_.Kill();
}
}
catch { }
} }
public void run() public void run()
@ -105,18 +90,18 @@ namespace v2rayN.Handler
{ {
while (!exitFlag_) while (!exitFlag_)
{ {
if (enabled_) if (enabled_ && channel_.State == ChannelState.Ready)
{ {
var res = client_.QueryStats(new QueryStatsRequest() { Pattern = "", Reset = true });
var addr = config_.address(); var addr = config_.address();
var port = config_.port(); var port = config_.port();
var cur = Statistic.FindIndex(item => item.address == addr && item.port == port); var cur = Statistic.FindIndex(item => item.address == addr && item.port == port);
connector_.Start(); ulong up = 0,
string output = connector_.StandardOutput.ReadToEnd(); down = 0;
UInt64 up = 0;
UInt64 down = 0;
//TODO: parse output //TODO: parse output
parseOutput(output, out up, out down); parseOutput(res.Stat, out up, out down);
Up = up; Up = up;
Down = down; Down = down;
@ -135,49 +120,42 @@ namespace v2rayN.Handler
if (UpdateUI) if (UpdateUI)
updateFunc_(TotalUp, TotalDown, Up, Down, Statistic); updateFunc_(TotalUp, TotalDown, Up, Down, Statistic);
Thread.Sleep(config_.statisticsFreshRate); Thread.Sleep(config_.statisticsFreshRate);
channel_.ConnectAsync();
} }
} }
} }
catch { } catch { }
} }
public void parseOutput(string source, out UInt64 up, out UInt64 down) public void parseOutput(Google.Protobuf.Collections.RepeatedField<Stat> source, out ulong up, out ulong down)
{ {
// (?<=name: ")(.*?)(?=")|(?<=value: )(.*?)
var datas = Regex.Matches(source, "(?<=name: \")(?<name>.*?)(?=\").*?(?<=value: )(?<value>.*?)(?=>)", RegexOptions.Singleline);
up = 0; down = 0; up = 0; down = 0;
foreach(Match match in datas) foreach(var stat in source)
{ {
var g = match.Groups; var name = stat.Name;
var name = g["name"].Value; var value = stat.Value;
var value = g["value"].Value;
var nStr = name.Split(">>>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var nStr = name.Split(">>>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
var type = ""; var type = "";
name = name.Trim(); name = name.Trim();
value = value.Trim();
name = nStr[1]; name = nStr[1];
type = nStr[3]; type = nStr[3];
try
{
if (name == Global.InboundProxyTagName) if (name == Global.InboundProxyTagName)
{ {
if (type == "uplink") if (type == "uplink")
{ {
up = UInt64.Parse(value); up = (ulong)value;
} }
else if (type == "downlink") else if (type == "downlink")
{ {
down = UInt64.Parse(value); down = (ulong)value;
} }
} }
} }
catch { }
}
} }
public void saveToFile() public void saveToFile()

View File

@ -0,0 +1,53 @@
syntax = "proto3";
package v2ray.core.app.stats.command;
option csharp_namespace = "v2rayN.Protos.Statistics";
message GetStatsRequest {
// Name of the stat counter.
string name = 1;
// Whether or not to reset the counter to fetching its value.
bool reset = 2;
}
message Stat {
string name = 1;
int64 value = 2;
}
message GetStatsResponse {
Stat stat = 1;
}
message QueryStatsRequest {
string pattern = 1;
bool reset = 2;
}
message QueryStatsResponse {
repeated Stat stat = 1;
}
message SysStatsRequest {
}
message SysStatsResponse {
uint32 NumGoroutine = 1;
uint32 NumGC = 2;
uint64 Alloc = 3;
uint64 TotalAlloc = 4;
uint64 Sys = 5;
uint64 Mallocs = 6;
uint64 Frees = 7;
uint64 LiveObjects = 8;
uint64 PauseTotalNs = 9;
uint32 Uptime = 10;
}
service StatsService {
rpc GetStats(GetStatsRequest) returns (GetStatsResponse) {}
rpc QueryStats(QueryStatsRequest) returns (QueryStatsResponse) {}
rpc GetSysStats(SysStatsRequest) returns (SysStatsResponse) {}
}
message Config {}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.9.1" targetFramework="net46" />
<package id="Grpc" version="2.23.0" targetFramework="net46" />
<package id="Grpc.Core" version="2.23.0" targetFramework="net46" />
<package id="Grpc.Core.Api" version="2.23.0" targetFramework="net46" />
<package id="Grpc.Tools" version="2.23.0" targetFramework="net46" developmentDependency="true" />
<package id="System.Buffers" version="4.4.0" targetFramework="net46" />
<package id="System.Memory" version="4.5.3" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
</packages>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props" Condition="Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -74,11 +75,23 @@
<PropertyGroup /> <PropertyGroup />
<PropertyGroup /> <PropertyGroup />
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.9.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.9.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<HintPath>..\packages\Grpc.Core.2.23.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
<Reference Include="Grpc.Core.Api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<HintPath>..\packages\Grpc.Core.Api.2.23.0\lib\net45\Grpc.Core.Api.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>.\Newtonsoft.Json.dll</HintPath> <HintPath>.\Newtonsoft.Json.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
@ -87,7 +100,13 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" /> <Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net" /> <Reference Include="System.Net" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="zxing"> <Reference Include="zxing">
@ -295,6 +314,7 @@
<EmbeddedResource Include="app.config"> <EmbeddedResource Include="app.config">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -304,6 +324,7 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Protobuf Include="Protos\Statistics.proto" />
<None Include="Resources\abp.js.gz" /> <None Include="Resources\abp.js.gz" />
<None Include="Resources\pac.txt.gz" /> <None Include="Resources\pac.txt.gz" />
<None Include="Resources\sysproxy.exe.gz" /> <None Include="Resources\sysproxy.exe.gz" />
@ -382,14 +403,22 @@
<EmbeddedResource Include="zxing.presentation.dll" /> <EmbeddedResource Include="zxing.presentation.dll" />
<EmbeddedResource Include="zxing.dll" /> <EmbeddedResource Include="zxing.dll" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="protos\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>
</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.2.23.0\build\net45\Grpc.Core.targets'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.props'))" />
<Error Condition="!Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets'))" />
</Target>
<Import Project="..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets" Condition="Exists('..\packages\Grpc.Tools.2.23.0\build\Grpc.Tools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">