From 299b8a2eea5a05a81a1a675c0af6819a4b7238e2 Mon Sep 17 00:00:00 2001 From: SpringHgui <740360381@qq.com> Date: Sat, 21 Dec 2019 13:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=81=97=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++ FastTunnel.Core/Models/NewSSHRequest.cs | 13 +++++++++ FastTunnel.Core/Models/Protocol.cs | 11 +++++++ FastTunnel.Core/Models/SSHConfig.cs | 29 +++++++++++++++++++ FastTunnel.Core/Models/SSHHandlerArg.cs | 13 +++++++++ FastTunnel.Core/Models/SSHInfo.cs | 16 ++++++++++ .../PublishProfiles/FolderProfile.pubxml | 14 +++++++++ 7 files changed, 100 insertions(+) create mode 100644 FastTunnel.Core/Models/NewSSHRequest.cs create mode 100644 FastTunnel.Core/Models/Protocol.cs create mode 100644 FastTunnel.Core/Models/SSHConfig.cs create mode 100644 FastTunnel.Core/Models/SSHHandlerArg.cs create mode 100644 FastTunnel.Core/Models/SSHInfo.cs create mode 100644 FastTunnel.Server/Properties/PublishProfiles/FolderProfile.pubxml diff --git a/.gitignore b/.gitignore index 2cd48b4..c643516 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ bin obj .vs +/FastTunnel.Client/*.user +/FastTunnel.Server/*.user +/FastTunnel.Client/Properties/PublishProfiles/*.user +/FastTunnel.Server/Properties/PublishProfiles/*.user diff --git a/FastTunnel.Core/Models/NewSSHRequest.cs b/FastTunnel.Core/Models/NewSSHRequest.cs new file mode 100644 index 0000000..59fd096 --- /dev/null +++ b/FastTunnel.Core/Models/NewSSHRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FastTunnel.Core.Models +{ + public class NewSSHRequest + { + public string MsgId { get; set; } + + public SSHConfig SSHConfig { get; set; } + } +} diff --git a/FastTunnel.Core/Models/Protocol.cs b/FastTunnel.Core/Models/Protocol.cs new file mode 100644 index 0000000..bdcc5c6 --- /dev/null +++ b/FastTunnel.Core/Models/Protocol.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FastTunnel.Core.Models +{ + public enum Protocol + { + TCP = 0, + } +} diff --git a/FastTunnel.Core/Models/SSHConfig.cs b/FastTunnel.Core/Models/SSHConfig.cs new file mode 100644 index 0000000..fff4ce6 --- /dev/null +++ b/FastTunnel.Core/Models/SSHConfig.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FastTunnel.Core.Models +{ + public class SSHConfig + { + /// + /// 协议 + /// + public Protocol Protocol { get; set; } + + /// + /// 局域网IP地址 + /// + public string LocalIp { get; set; } + + /// + /// 局域网ssh端口号 + /// + public int LocalPort { get; set; } = 22; + + /// + /// 服务端监听的端口号 1~65535 + /// + public int RemotePort { get; set; } + } +} diff --git a/FastTunnel.Core/Models/SSHHandlerArg.cs b/FastTunnel.Core/Models/SSHHandlerArg.cs new file mode 100644 index 0000000..564f624 --- /dev/null +++ b/FastTunnel.Core/Models/SSHHandlerArg.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Net.Sockets; +using System.Text; + +namespace FastTunnel.Core.Models +{ + public class SSHHandlerArg + { + public SSHConfig SSHConfig { get; internal set; } + public Socket LocalClient { get; internal set; } + } +} diff --git a/FastTunnel.Core/Models/SSHInfo.cs b/FastTunnel.Core/Models/SSHInfo.cs new file mode 100644 index 0000000..016604b --- /dev/null +++ b/FastTunnel.Core/Models/SSHInfo.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Net.Sockets; +using System.Text; + +namespace FastTunnel.Core.Models +{ + public class SSHInfo + { + public Socket Socket { get; set; } + + public SSHConfig SSHConfig { get; set; } + + public Listener Listener { get; set; } + } +} diff --git a/FastTunnel.Server/Properties/PublishProfiles/FolderProfile.pubxml b/FastTunnel.Server/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..47d90a6 --- /dev/null +++ b/FastTunnel.Server/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + Release + Any CPU + netcoreapp3.1 + bin\Release\netcoreapp3.1\publish\ + false + + \ No newline at end of file