first commit
This commit is contained in:
207
Ultron.Proxy.Server/ClientConnectionManager.cs
Normal file
207
Ultron.Proxy.Server/ClientConnectionManager.cs
Normal file
@@ -0,0 +1,207 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks.Dataflow;
|
||||
using Ultron.Proxy.Models;
|
||||
using Ultron.Proxy.Utils;
|
||||
|
||||
namespace Ultron.Proxy
|
||||
{
|
||||
/// <summary>
|
||||
/// 反向连接处理类
|
||||
/// </summary>
|
||||
public class ClientConnectionManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 当app增加时触发
|
||||
/// </summary>
|
||||
public event EventHandler<AppChangedEventArgs> AppTcpClientMapReverseConnected = delegate { };
|
||||
public event EventHandler<AppChangedEventArgs> AppTcpClientMapConfigConnected = delegate { };
|
||||
//public event EventHandler<AppChangedEventArgs> AppRemoved = delegate { };
|
||||
|
||||
//端口和app的映射关系,需定时清理
|
||||
public Dictionary<int, AppModel> PortAppMap = new Dictionary<int, AppModel>();
|
||||
|
||||
//app和代理客户端socket之间的映射关系
|
||||
public ConcurrentDictionary<ClientIDAppID, BufferBlock<TcpClient>> AppTcpClientMap = new ConcurrentDictionary<ClientIDAppID, BufferBlock<TcpClient>>();
|
||||
|
||||
//已注册的clientID,和appid之间的关系,appid序号=元素下标序号+1
|
||||
public Dictionary<int, List<ClientIDAppID>> RegisteredClient = new Dictionary<int, List<ClientIDAppID>>();
|
||||
|
||||
private ClientConnectionManager()
|
||||
{
|
||||
ServerHost.Logger.Debug("ClientManager initialized");
|
||||
Task.Run(ListenServiceClient);
|
||||
}
|
||||
|
||||
private object _lockObject = new Object();
|
||||
private object _lockObject2 = new Object();
|
||||
private Random _rand = new Random();
|
||||
private async Task ListenServiceClient()
|
||||
{
|
||||
//侦听,并且构造连接池
|
||||
ServerHost.Logger.Debug("Listening client on port " + ServerHost.ClientServicePort + "...");
|
||||
TcpListener listenter = new TcpListener(IPAddress.Any, ServerHost.ClientServicePort);
|
||||
listenter.Start(1000);
|
||||
while (true)
|
||||
{
|
||||
TcpClient incomeClient = await listenter.AcceptTcpClientAsync();
|
||||
ServerHost.Logger.Debug("已建立一个空连接");
|
||||
ProcessReverseRequest(incomeClient);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理反向连接请求
|
||||
/// </summary>
|
||||
/// <param name="incomeClient"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ProcessReverseRequest(TcpClient incomeClient)
|
||||
{
|
||||
try
|
||||
{
|
||||
//读取头四个字节
|
||||
byte[] bytes = new byte[4];
|
||||
await incomeClient.GetStream().ReadAsync(bytes);
|
||||
|
||||
var clientIdAppId = GetAppFromBytes(bytes);
|
||||
ServerHost.Logger.Debug("已获取到消息ClientID:" + clientIdAppId.ClientID.ToString()
|
||||
+ "AppID:" + clientIdAppId.AppID.ToString()
|
||||
);
|
||||
//分配
|
||||
lock (_lockObject)
|
||||
{
|
||||
AppTcpClientMap.GetOrAdd(clientIdAppId, new BufferBlock<TcpClient>()).Post(incomeClient);
|
||||
}
|
||||
//var arg = new AppChangedEventArgs();
|
||||
//arg.App = clientIdAppId;
|
||||
//AppTcpClientMapReverseConnected(this, arg);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ServerHost.Logger.Debug(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static ClientConnectionManager Instance = new Lazy<ClientConnectionManager>(() => new ClientConnectionManager()).Value;
|
||||
|
||||
public static ClientConnectionManager GetInstance()
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
|
||||
public async Task<TcpClient> GetClient(int consumerPort)
|
||||
{
|
||||
//从字典的list中取出tcpclient,并将其移除
|
||||
ClientIDAppID clientappid = PortAppMap[consumerPort].ClientIdAppId;
|
||||
|
||||
TcpClient client = await AppTcpClientMap[clientappid].ReceiveAsync();
|
||||
PortAppMap[consumerPort].ReverseClients.Add(client);
|
||||
// AppTcpClientMap[clientappid].Remove(client);
|
||||
//AppRemoved(this, new AppChangedEventArgs { App = clientappid });
|
||||
return client;
|
||||
}
|
||||
|
||||
//通过客户端的id请求,分配好服务端端口和appid交给客户端
|
||||
//arrange ConfigId from top 4 bytes which received from client.
|
||||
//response:
|
||||
// 2 1 1 1 1 ...N
|
||||
// clientid appid port appid2 port2
|
||||
//request:
|
||||
// 2 2
|
||||
// clientid count
|
||||
// methodType value = 0
|
||||
public byte[] ArrageConfigIds(byte[] appRequestBytes, byte[] consumerPortBytes)
|
||||
{
|
||||
// byte[] arrangedBytes = new byte[256];
|
||||
ClientModel clientModel = new ClientModel();
|
||||
int clientId = (appRequestBytes[0] << 8) + appRequestBytes[1];
|
||||
int appCount = (int)appRequestBytes[2];
|
||||
|
||||
if (clientId == 0)
|
||||
{
|
||||
lock (_lockObject)
|
||||
{
|
||||
byte[] tempClientIdBytes = new byte[2];
|
||||
//分配clientid
|
||||
for (int i = 0; i < 10000; i++)
|
||||
{
|
||||
_rand.NextBytes(tempClientIdBytes);
|
||||
int tempClientId = (tempClientIdBytes[0] << 8) + tempClientIdBytes[1];
|
||||
if (!RegisteredClient.ContainsKey(tempClientId))
|
||||
{
|
||||
|
||||
clientModel.ClientId = tempClientId;
|
||||
clientId = tempClientId;
|
||||
//注册客户端
|
||||
RegisteredClient.Add(tempClientId, new List<ClientIDAppID>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clientModel.ClientId = clientId;
|
||||
}
|
||||
lock (_lockObject2)
|
||||
{
|
||||
//循环获取appid,appid是元素下标+1
|
||||
int maxAppCount = RegisteredClient[clientId].Count;
|
||||
//增加请求的客户端
|
||||
//int[] ports = NetworkUtil.FindAvailableTCPPorts(20000, appCount);
|
||||
//foreach (var oneport in ports) Logger.Info(oneport + " ");
|
||||
clientModel.AppList = new List<App>(appCount);
|
||||
for (int i = 0; i < appCount; i++)
|
||||
{
|
||||
int startPort = StringUtil.DoubleBytesToInt(consumerPortBytes[2 * i], consumerPortBytes[2 * i + 1]);
|
||||
int arrangedAppid = maxAppCount + i + 1;
|
||||
if (arrangedAppid > 255) throw new Exception("Stack overflow.");
|
||||
//查找port的起始端口如果未指定,则设置为20000
|
||||
if (startPort == 0) startPort = 20000;
|
||||
int port = NetworkUtil.FindOneAvailableTCPPort(startPort);
|
||||
RegisteredClient[clientId].Add(new ClientIDAppID
|
||||
{
|
||||
ClientID = clientId,
|
||||
AppID = arrangedAppid
|
||||
});
|
||||
clientModel.AppList.Add(new App
|
||||
{
|
||||
AppId = arrangedAppid,
|
||||
Port = port
|
||||
});
|
||||
var appClient = PortAppMap[port] = new AppModel()
|
||||
{
|
||||
ClientIdAppId = new ClientIDAppID()
|
||||
{
|
||||
ClientID = clientId,
|
||||
AppID = arrangedAppid
|
||||
},
|
||||
Tunnels = new List<TcpTunnel>(),
|
||||
ReverseClients = new List<TcpClient>()
|
||||
};
|
||||
ServerHost.Logger.Info(port);
|
||||
//配置时触发
|
||||
AppTcpClientMapConfigConnected(this, new AppChangedEventArgs() { App = appClient.ClientIdAppId });
|
||||
}
|
||||
ServerHost.Logger.Debug(" <=端口已分配。");
|
||||
}
|
||||
return clientModel.ToBytes();
|
||||
}
|
||||
|
||||
private ClientIDAppID GetAppFromBytes(byte[] bytes)
|
||||
{
|
||||
return new ClientIDAppID()
|
||||
{
|
||||
ClientID = (bytes[0] << 8) + bytes[1],
|
||||
AppID = bytes[2]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
116
Ultron.Proxy.Server/Server.cs
Normal file
116
Ultron.Proxy.Server/Server.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
using Ultron.Proxy.Interfaces;
|
||||
|
||||
namespace Ultron.Proxy
|
||||
{
|
||||
class Server
|
||||
{
|
||||
public class Log4netLogger : ILogger
|
||||
{
|
||||
public void Debug(object message)
|
||||
{
|
||||
//Logger.Debug(message);
|
||||
Logger.Debug(message);
|
||||
}
|
||||
|
||||
public void Error(object message, Exception ex)
|
||||
{
|
||||
//Logger.Debug(message);
|
||||
Logger.Error(message,ex);
|
||||
}
|
||||
|
||||
public void Info(object message)
|
||||
{
|
||||
Logger.Info(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static IConfigurationRoot Configuration { get; set; }
|
||||
public static ILog Logger;
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//log
|
||||
var loggerRepository = LogManager.CreateRepository("NSmartServerRepository");
|
||||
XmlConfigurator.ConfigureAndWatch(loggerRepository, new FileInfo("log4net.config"));
|
||||
Logger = LogManager.GetLogger(loggerRepository.Name, "NSmartServer");
|
||||
if (!loggerRepository.Configured) throw new Exception("log config failed.");
|
||||
|
||||
Logger.Debug("*** Ultron.Proxy Server v0.1 ***");
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json");
|
||||
|
||||
Configuration = builder.Build();
|
||||
StartServer();
|
||||
}
|
||||
|
||||
private static void StartServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
ServerHost.ClientServicePort = int.Parse(Configuration.GetSection("ClientServicePort").Value);
|
||||
ServerHost.ConfigServicePort = int.Parse(Configuration.GetSection("ConfigServicePort").Value);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug("配置文件读取失败:" + ex.ToString());
|
||||
return;
|
||||
}
|
||||
ServerHost srv = new ServerHost(new Log4netLogger());
|
||||
|
||||
int retryCount = 0;
|
||||
while (true)
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
|
||||
try
|
||||
{
|
||||
watch.Start();
|
||||
srv.SetWebPort(int.Parse(Configuration.GetSection("WebAPIPort").Value))
|
||||
.Start()
|
||||
.Wait();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug(ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
//短时间多次出错则终止服务器
|
||||
if (watch.Elapsed > TimeSpan.FromSeconds(10))
|
||||
{
|
||||
retryCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
retryCount++;
|
||||
}
|
||||
if (retryCount > 100) break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Logger.Debug("Ultron.Proxy server terminated. Press any key to continue.");
|
||||
try
|
||||
{
|
||||
Console.Read();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class ProxyClient
|
||||
{
|
||||
}
|
||||
}
|
||||
9
Ultron.Proxy.Server/ServerClient.cs
Normal file
9
Ultron.Proxy.Server/ServerClient.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Ultron.Proxy
|
||||
{
|
||||
public class ServerClient
|
||||
{
|
||||
public string ServerClientHash;
|
||||
}
|
||||
}
|
||||
434
Ultron.Proxy.Server/ServerHost.cs
Normal file
434
Ultron.Proxy.Server/ServerHost.cs
Normal file
@@ -0,0 +1,434 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Ultron.Proxy.Utils;
|
||||
using Ultron.Proxy.Interfaces;
|
||||
|
||||
namespace Ultron.Proxy
|
||||
{
|
||||
//+------------------------+
|
||||
//| NAT |
|
||||
//| |
|
||||
//| |
|
||||
//| +----------+ | +-----------+
|
||||
//| | | | | |
|
||||
//| | client |------------> provider |
|
||||
//| | | | | |
|
||||
//| +----+-----+ | +------^----+
|
||||
//| | | |
|
||||
//| | | |
|
||||
//| | | |
|
||||
//| +----V-----+ | |
|
||||
//| | | | |
|
||||
//| | IIS | | |
|
||||
//| | | | |
|
||||
//| +----------+ | +------+-------+
|
||||
//| | | |
|
||||
//| | | consumer |
|
||||
//| | | |
|
||||
//+------------------------+ +--------------+
|
||||
public class ServerHost
|
||||
{
|
||||
//服务端代理转发端口
|
||||
public static int ClientServicePort = 9973;
|
||||
//服务端配置通讯端口
|
||||
public static int ConfigServicePort = 12307;
|
||||
//远端管理端口
|
||||
public static int WebManagementPort = 0;
|
||||
|
||||
public ClientConnectionManager ConnectionManager = null;
|
||||
|
||||
//inject
|
||||
internal static ILogger Logger;
|
||||
|
||||
public ServerHost(ILogger logger)
|
||||
{
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
//必须设置远程端口才可以通信
|
||||
public ServerHost SetWebPort(int port)
|
||||
{
|
||||
WebManagementPort = port;
|
||||
return this;
|
||||
}
|
||||
|
||||
public async Task Start()
|
||||
{
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
CancellationTokenSource ctsConfig = new CancellationTokenSource();
|
||||
CancellationTokenSource ctsHttp = new CancellationTokenSource();
|
||||
CancellationTokenSource ctsConsumer = new CancellationTokenSource();
|
||||
|
||||
//1.反向连接池配置
|
||||
ConnectionManager = ClientConnectionManager.GetInstance();
|
||||
//注册客户端发生连接时的事件
|
||||
ConnectionManager.AppTcpClientMapConfigConnected += ConnectionManager_AppAdded;
|
||||
Logger.Debug("Ultron.Proxy server started");
|
||||
|
||||
//2.开启http服务
|
||||
if (WebManagementPort > 0)
|
||||
StartHttpService(ctsHttp);
|
||||
|
||||
//3.开启配置服务
|
||||
|
||||
try
|
||||
{
|
||||
await StartConfigService(ctsConfig);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Logger.Debug("all closed");
|
||||
ctsConfig.Cancel();
|
||||
//listenerConsumer.Stop();
|
||||
}
|
||||
////4.通过已配置的端口集合开启侦听
|
||||
//foreach (var kv in ConnectionManager.PortAppMap)
|
||||
//{
|
||||
// ListenConsumeAsync(kv.Key, ctsConsumer.Token);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
Logger.Error(e.Exception.ToString(), e.Exception);
|
||||
}
|
||||
|
||||
#region HTTPServer
|
||||
private async Task StartHttpService(CancellationTokenSource ctsHttp)
|
||||
{
|
||||
try
|
||||
{
|
||||
HttpListener listener = new HttpListener();
|
||||
listener.Prefixes.Add($"http://127.0.0.1:{WebManagementPort}/");
|
||||
//TcpListener listenerConfigService = new TcpListener(IPAddress.Any, WebManagementPort);
|
||||
Logger.Debug("Listening HTTP request on port " + WebManagementPort.ToString() + "...");
|
||||
await AcceptHttpRequest(listener, ctsHttp);
|
||||
}
|
||||
catch (HttpListenerException ex)
|
||||
{
|
||||
Logger.Debug("Please run this program in administrator mode." + ex);
|
||||
ServerHost.Logger.Error(ex.ToString(), ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug(ex);
|
||||
ServerHost.Logger.Error(ex.ToString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task AcceptHttpRequest(HttpListener httpService, CancellationTokenSource ctsHttp)
|
||||
{
|
||||
httpService.Start();
|
||||
while (true)
|
||||
{
|
||||
var client = await httpService.GetContextAsync();
|
||||
ProcessHttpRequestAsync(client);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ProcessHttpRequestAsync(HttpListenerContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var request = context.Request;
|
||||
var response = context.Response;
|
||||
|
||||
response.ContentEncoding = Encoding.UTF8;
|
||||
response.ContentType = "text/html;charset=utf-8";
|
||||
|
||||
//getJson
|
||||
StringBuilder json = new StringBuilder("[ ");
|
||||
foreach (var app in this.ConnectionManager.PortAppMap)
|
||||
{
|
||||
json.Append("{ ");
|
||||
json.Append(KV2Json("port", app.Key)).C();
|
||||
json.Append(KV2Json("clientId", app.Value.ClientIdAppId.ClientID)).C();
|
||||
json.Append(KV2Json("appId", app.Value.ClientIdAppId.AppID)).C();
|
||||
|
||||
//反向连接
|
||||
json.Append(KV2Json("revconns"));
|
||||
json.Append("[ ");
|
||||
foreach (var reverseClient in app.Value.ReverseClients)
|
||||
{
|
||||
json.Append("{ ");
|
||||
if (reverseClient.Connected)
|
||||
{
|
||||
json.Append(KV2Json("lEndPoint", reverseClient.Client.LocalEndPoint.ToString())).C();
|
||||
json.Append(KV2Json("rEndPoint", reverseClient.Client.RemoteEndPoint.ToString()));
|
||||
}
|
||||
|
||||
//json.Append(KV2Json("p", c)).C();
|
||||
//json.Append(KV2Json("port", ca.Key));
|
||||
json.Append("}");
|
||||
json.C();
|
||||
}
|
||||
json.D();
|
||||
json.Append("]").C(); ;
|
||||
|
||||
//隧道状态
|
||||
json.Append(KV2Json("tunnels"));
|
||||
json.Append("[ ");
|
||||
foreach (var tunnel in app.Value.Tunnels)
|
||||
{
|
||||
json.Append("{ ");
|
||||
if (tunnel.ClientServerClient.Connected)
|
||||
|
||||
json.Append(KV2Json("clientServerClient", tunnel.ClientServerClient?.Client.LocalEndPoint.ToString())).C();
|
||||
if (tunnel.ConsumerClient.Connected)
|
||||
json.Append(KV2Json("consumerClient", tunnel.ConsumerClient?.Client.LocalEndPoint.ToString())).C();
|
||||
|
||||
json.D();
|
||||
//json.Append(KV2Json("p", c)).C();
|
||||
//json.Append(KV2Json("port", ca.Key));
|
||||
json.Append("}");
|
||||
json.C();
|
||||
}
|
||||
json.D();
|
||||
json.Append("]");
|
||||
json.Append("}").C();
|
||||
}
|
||||
json.D();
|
||||
json.Append("]");
|
||||
await response.OutputStream.WriteAsync(HtmlUtil.GetContent(json.ToString()));
|
||||
//await response.OutputStream.WriteAsync(HtmlUtil.GetContent(request.RawUrl));
|
||||
response.OutputStream.Close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e.Message, e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private string KV2Json(string key)
|
||||
{
|
||||
return "\"" + key + "\":";
|
||||
}
|
||||
private string KV2Json(string key, object value)
|
||||
{
|
||||
return "\"" + key + "\":\"" + value.ToString() + "\"";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private async Task StartConfigService(CancellationTokenSource accepting)
|
||||
{
|
||||
TcpListener listenerConfigService = new TcpListener(IPAddress.Any, ConfigServicePort);
|
||||
|
||||
|
||||
Logger.Debug("Listening config request on port " + ConfigServicePort.ToString() + "...");
|
||||
var taskResultConfig = AcceptConfigRequest(listenerConfigService);
|
||||
|
||||
await taskResultConfig; //block here to hold open the server
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 有连接连上则开始侦听新的端口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void ConnectionManager_AppAdded(object sender, AppChangedEventArgs e)
|
||||
{
|
||||
Logger.Debug("AppTcpClientMapReverseConnected事件已触发");
|
||||
int port = 0;
|
||||
foreach (var kv in ConnectionManager.PortAppMap)
|
||||
{
|
||||
if (kv.Value.ClientIdAppId.AppID == e.App.AppID &&
|
||||
kv.Value.ClientIdAppId.ClientID == e.App.ClientID) port = kv.Key;
|
||||
}
|
||||
if (port == 0) throw new Exception("app未注册");
|
||||
var ct = new CancellationToken();
|
||||
|
||||
|
||||
ListenConsumeAsync(port, ct);
|
||||
}
|
||||
|
||||
#region 配置
|
||||
//配置服务,客户端可以通过这个服务接收现有的空闲端口
|
||||
//accept a config request.
|
||||
//request:
|
||||
// 2 1 1
|
||||
// clientid appid nouse
|
||||
//
|
||||
//response:
|
||||
// 2 1 1 ...N
|
||||
// clientid appid port
|
||||
private async Task AcceptConfigRequest(TcpListener listenerConfigService)
|
||||
{
|
||||
listenerConfigService.Start(100);
|
||||
while (true)
|
||||
{
|
||||
var client = await listenerConfigService.AcceptTcpClientAsync();
|
||||
ProcessConfigRequestAsync(client);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ProcessConfigRequestAsync(TcpClient client)
|
||||
{
|
||||
try
|
||||
{
|
||||
//长度固定4个字节
|
||||
int configRequestLength = 3;
|
||||
byte[] appRequestBytes = new byte[configRequestLength];
|
||||
Logger.Debug("config request received.");
|
||||
var nstream = client.GetStream();
|
||||
|
||||
//1.读取配置请求1
|
||||
int resultByte = await nstream.ReadAsync(appRequestBytes);
|
||||
Logger.Debug("appRequestBytes received.");
|
||||
if (resultByte == 0)
|
||||
{
|
||||
CloseClient(client);
|
||||
return;
|
||||
}
|
||||
//2.根据配置请求1获取更多配置信息
|
||||
int appCount = (int)appRequestBytes[2];
|
||||
byte[] consumerPortBytes = new byte[appCount * 2];
|
||||
int resultByte2 = await nstream.ReadAsync(consumerPortBytes);
|
||||
Logger.Debug("consumerPortBytes received.");
|
||||
if (resultByte2 == 0)
|
||||
{
|
||||
CloseClient(client);
|
||||
return;
|
||||
}
|
||||
|
||||
//3.分配配置ID,并且写回给客户端
|
||||
try
|
||||
{
|
||||
byte[] arrangedIds = ConnectionManager.ArrageConfigIds(appRequestBytes, consumerPortBytes);
|
||||
Logger.Debug("apprequest arranged");
|
||||
await nstream.WriteAsync(arrangedIds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ Logger.Debug(ex.ToString()); }
|
||||
|
||||
|
||||
Logger.Debug("arrangedIds written.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Debug(e);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同时侦听来自consumer的链接和到provider的链接
|
||||
/// </summary>
|
||||
/// <param name="consumerlistener"></param>
|
||||
/// <param name="ct"></param>
|
||||
/// <returns></returns>
|
||||
async Task ListenConsumeAsync(int consumerPort, CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var consumerlistener = new TcpListener(IPAddress.Any, consumerPort);
|
||||
consumerlistener.Start(1000);
|
||||
//给两个listen,同时监听3端
|
||||
var clientCounter = 0;
|
||||
while (!ct.IsCancellationRequested)
|
||||
{
|
||||
//目标的代理服务联通了,才去处理consumer端的请求。
|
||||
Logger.Debug("listening serviceClient....Port:" + consumerPort);
|
||||
TcpClient consumerClient = await consumerlistener.AcceptTcpClientAsync();
|
||||
//记录tcp隧道,消费端
|
||||
TcpTunnel tunnel = new TcpTunnel();
|
||||
tunnel.ConsumerClient = consumerClient;
|
||||
ClientConnectionManager.GetInstance().PortAppMap[consumerPort].Tunnels.Add(tunnel);
|
||||
Logger.Debug("consumer已连接:" + consumerClient.Client.RemoteEndPoint.ToString());
|
||||
//消费端连接成功,连接
|
||||
|
||||
|
||||
//需要端口
|
||||
TcpClient s2pClient = await ConnectionManager.GetClient(consumerPort);
|
||||
//记录tcp隧道,客户端
|
||||
tunnel.ClientServerClient = s2pClient;
|
||||
//✳关键过程✳
|
||||
//连接完之后发送一个字节过去促使客户端建立转发隧道
|
||||
await s2pClient.GetStream().WriteAsync(new byte[] { 1 }, 0, 1);
|
||||
clientCounter++;
|
||||
|
||||
TcpTransferAsync(consumerlistener, consumerClient, s2pClient, clientCounter, ct);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Debug(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region datatransfer
|
||||
//3端互相传输数据
|
||||
async Task TcpTransferAsync(TcpListener consumerlistener, TcpClient consumerClient, TcpClient providerClient,
|
||||
int clientIndex,
|
||||
CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
ServerHost.Logger.Debug($"New client ({clientIndex}) connected");
|
||||
|
||||
CancellationTokenSource transfering = new CancellationTokenSource();
|
||||
|
||||
var providerStream = providerClient.GetStream();
|
||||
var consumerStream = consumerClient.GetStream();
|
||||
Task taskC2PLooping = ToStaticTransfer(transfering.Token, consumerStream, providerStream);
|
||||
Task taskP2CLooping = StreamTransfer(transfering.Token, providerStream, consumerStream);
|
||||
|
||||
//任何一端传输中断或者故障,则关闭所有连接
|
||||
var comletedTask = await Task.WhenAny(taskC2PLooping, taskP2CLooping);
|
||||
//comletedTask.
|
||||
Logger.Debug($"Transferring ({clientIndex}) STOPPED");
|
||||
consumerClient.Close();
|
||||
providerClient.Close();
|
||||
transfering.Cancel();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Debug(e);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task StreamTransfer(CancellationToken ct, NetworkStream fromStream, NetworkStream toStream)
|
||||
{
|
||||
await fromStream.CopyToAsync(toStream, ct);
|
||||
}
|
||||
|
||||
private async Task ToStaticTransfer(CancellationToken ct, NetworkStream fromStream, NetworkStream toStream, Func<byte[], Task<bool>> beforeTransferHandle = null)
|
||||
{
|
||||
await fromStream.CopyToAsync(toStream, ct);
|
||||
}
|
||||
|
||||
private void CloseClient(TcpClient client)
|
||||
{
|
||||
Logger.Debug("invalid request,Closing client:" + client.Client.RemoteEndPoint.ToString());
|
||||
client.Close();
|
||||
Logger.Debug("Closed client:" + client.Client.RemoteEndPoint.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
30
Ultron.Proxy.Server/ServerModels.cs
Normal file
30
Ultron.Proxy.Server/ServerModels.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace Ultron.Proxy
|
||||
{
|
||||
public struct ClientIDAppID
|
||||
{
|
||||
public int ClientID;
|
||||
public int AppID;
|
||||
}
|
||||
|
||||
public class TcpTunnel
|
||||
{
|
||||
public TcpClient ConsumerClient;
|
||||
public TcpClient ClientServerClient;
|
||||
}
|
||||
|
||||
public class AppModel
|
||||
{
|
||||
public ClientIDAppID ClientIdAppId;
|
||||
public List<TcpTunnel> Tunnels; //正在使用的隧道
|
||||
public List<TcpClient> ReverseClients; //反向连接的socket
|
||||
}
|
||||
|
||||
public class AppChangedEventArgs : EventArgs
|
||||
{
|
||||
public ClientIDAppID App;
|
||||
}
|
||||
}
|
||||
33
Ultron.Proxy.Server/Ultron.Proxy.Server.csproj
Normal file
33
Ultron.Proxy.Server/Ultron.Proxy.Server.csproj
Normal file
@@ -0,0 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
|
||||
<AssemblyName>uProxyServer</AssemblyName>
|
||||
<RootNamespace>Ultron.Proxy</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="log4net" Version="2.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ultron.Proxy\Ultron.Proxy.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="log4net.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<LangVersion>7.1</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
|
||||
|
||||
</Project>
|
||||
5
Ultron.Proxy.Server/appsettings.json
Normal file
5
Ultron.Proxy.Server/appsettings.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"ClientServicePort": 8001, //反向连接端口
|
||||
"ConfigServicePort": 8000, //配置服务端口
|
||||
"WebAPIPort": 8002 //API服务端口
|
||||
}
|
||||
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/Ultron.Proxy.dll
Normal file
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/Ultron.Proxy.dll
Normal file
Binary file not shown.
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/Ultron.Proxy.pdb
Normal file
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/Ultron.Proxy.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"ClientServicePort": 8001, //反向连接端口
|
||||
"ConfigServicePort": 8000, //配置服务端口
|
||||
"WebAPIPort": 8002 //API服务端口
|
||||
}
|
||||
38
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/log/20190402.log
Normal file
38
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/log/20190402.log
Normal file
@@ -0,0 +1,38 @@
|
||||
2019-04-02 17:06:18,581 [1] DEBUG NSmartServer [(null)] - *** Ultron.Proxy Server v0.1 ***
|
||||
2019-04-02 17:06:19,098 [1] DEBUG NSmartServer [(null)] - ClientManager initialized
|
||||
2019-04-02 17:06:19,116 [1] DEBUG NSmartServer [(null)] - Ultron.Proxy server started
|
||||
2019-04-02 17:06:19,118 [6] DEBUG NSmartServer [(null)] - Listening client on port 8001...
|
||||
2019-04-02 17:06:19,181 [1] DEBUG NSmartServer [(null)] - Listening HTTP request on port 8002...
|
||||
2019-04-02 17:06:19,193 [1] DEBUG NSmartServer [(null)] - Listening config request on port 8000...
|
||||
2019-04-02 17:10:23,589 [1] DEBUG NSmartServer [(null)] - *** Ultron.Proxy Server v0.1 ***
|
||||
2019-04-02 17:10:24,216 [1] DEBUG NSmartServer [(null)] - ClientManager initialized
|
||||
2019-04-02 17:10:24,227 [1] DEBUG NSmartServer [(null)] - Ultron.Proxy server started
|
||||
2019-04-02 17:10:24,241 [6] DEBUG NSmartServer [(null)] - Listening client on port 8001...
|
||||
2019-04-02 17:10:24,315 [1] DEBUG NSmartServer [(null)] - Listening HTTP request on port 8002...
|
||||
2019-04-02 17:10:24,329 [1] DEBUG NSmartServer [(null)] - Listening config request on port 8000...
|
||||
2019-04-02 17:11:24,123 [5] DEBUG NSmartServer [(null)] - config request received.
|
||||
2019-04-02 17:11:37,897 [5] DEBUG NSmartServer [(null)] - appRequestBytes received.
|
||||
2019-04-02 17:11:42,602 [5] DEBUG NSmartServer [(null)] - consumerPortBytes received.
|
||||
2019-04-02 17:11:42,633 [5] INFO NSmartServer [(null)] - 8004
|
||||
2019-04-02 17:11:52,528 [5] DEBUG NSmartServer [(null)] - AppTcpClientMapReverseConnected事件已触发
|
||||
2019-04-02 17:12:14,473 [5] DEBUG NSmartServer [(null)] - listening serviceClient....Port:8004
|
||||
2019-04-02 17:12:16,436 [5] INFO NSmartServer [(null)] - 81
|
||||
2019-04-02 17:12:18,641 [5] DEBUG NSmartServer [(null)] - AppTcpClientMapReverseConnected事件已触发
|
||||
2019-04-02 17:12:21,949 [5] DEBUG NSmartServer [(null)] - listening serviceClient....Port:81
|
||||
2019-04-02 17:12:21,951 [5] INFO NSmartServer [(null)] - 20000
|
||||
2019-04-02 17:12:23,501 [5] DEBUG NSmartServer [(null)] - AppTcpClientMapReverseConnected事件已触发
|
||||
2019-04-02 17:12:23,501 [5] DEBUG NSmartServer [(null)] - listening serviceClient....Port:20000
|
||||
2019-04-02 17:12:23,504 [5] INFO NSmartServer [(null)] - 20002
|
||||
2019-04-02 17:12:24,843 [5] DEBUG NSmartServer [(null)] - AppTcpClientMapReverseConnected事件已触发
|
||||
2019-04-02 17:12:24,844 [5] DEBUG NSmartServer [(null)] - listening serviceClient....Port:20002
|
||||
2019-04-02 17:12:24,844 [5] DEBUG NSmartServer [(null)] - <=端口已分配。
|
||||
2019-04-02 17:12:24,847 [5] DEBUG NSmartServer [(null)] - apprequest arranged
|
||||
2019-04-02 17:12:24,848 [5] DEBUG NSmartServer [(null)] - arrangedIds written.
|
||||
2019-04-02 17:12:38,865 [5] DEBUG NSmartServer [(null)] - 已建立一个空连接
|
||||
2019-04-02 17:12:38,867 [5] DEBUG NSmartServer [(null)] - 已获取到消息ClientID:8356AppID:1
|
||||
2019-04-02 17:12:43,750 [5] DEBUG NSmartServer [(null)] - 已建立一个空连接
|
||||
2019-04-02 17:12:43,750 [5] DEBUG NSmartServer [(null)] - 已获取到消息ClientID:8356AppID:2
|
||||
2019-04-02 17:12:43,751 [5] DEBUG NSmartServer [(null)] - 已建立一个空连接
|
||||
2019-04-02 17:12:43,771 [4] DEBUG NSmartServer [(null)] - 已获取到消息ClientID:8356AppID:3
|
||||
2019-04-02 17:12:43,772 [5] DEBUG NSmartServer [(null)] - 已建立一个空连接
|
||||
2019-04-02 17:12:43,773 [5] DEBUG NSmartServer [(null)] - 已获取到消息ClientID:8356AppID:4
|
||||
39
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/log4net.config
Normal file
39
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/log4net.config
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<!-- This section contains the log4net configuration settings -->
|
||||
<log4net>
|
||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
|
||||
<layout type="log4net.Layout.PatternLayout" value="%date{yyMMdd HH:mm:ss.fff} [%thread] %-5level %logger - %message%newline" />
|
||||
</appender>
|
||||
|
||||
<appender name="FileAppender" type="log4net.Appender.FileAppender">
|
||||
<file value="log-file.log" />
|
||||
<appendToFile value="true" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="log/" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Composite" />
|
||||
<staticLogFileName value="false" />
|
||||
<datePattern value="yyyyMMdd'.log'" />
|
||||
<maxSizeRollBackups value="10" />
|
||||
<maximumFileSize value="1MB" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Setup the root category, add the appenders and set the default level -->
|
||||
<root>
|
||||
<level value="ALL" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
<!--<appender-ref ref="FileAppender" />-->
|
||||
<appender-ref ref="RollingLogFileAppender" />
|
||||
</root>
|
||||
|
||||
</log4net>
|
||||
</configuration>
|
||||
1546
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.deps.json
Normal file
1546
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.dll
Normal file
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.dll
Normal file
Binary file not shown.
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.pdb
Normal file
BIN
Ultron.Proxy.Server/bin/Debug/netcoreapp2.2/uProxyServer.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\Administrator\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\Administrator\\.nuget\\packages",
|
||||
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "netcoreapp2.2",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "2.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Ultron.Proxy.Server/log4net.config
Normal file
39
Ultron.Proxy.Server/log4net.config
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<!-- This section contains the log4net configuration settings -->
|
||||
<log4net>
|
||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
|
||||
<layout type="log4net.Layout.PatternLayout" value="%date{yyMMdd HH:mm:ss.fff} [%thread] %-5level %logger - %message%newline" />
|
||||
</appender>
|
||||
|
||||
<appender name="FileAppender" type="log4net.Appender.FileAppender">
|
||||
<file value="log-file.log" />
|
||||
<appendToFile value="true" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="log/" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Composite" />
|
||||
<staticLogFileName value="false" />
|
||||
<datePattern value="yyyyMMdd'.log'" />
|
||||
<maxSizeRollBackups value="10" />
|
||||
<maximumFileSize value="1MB" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Setup the root category, add the appenders and set the default level -->
|
||||
<root>
|
||||
<level value="ALL" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
<!--<appender-ref ref="FileAppender" />-->
|
||||
<appender-ref ref="RollingLogFileAppender" />
|
||||
</root>
|
||||
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
cb7c718bf7b01601c15c7894f3ef004ddc51fe45
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
349a308d86ea950c3d2e082fb317e46d5c183236
|
||||
@@ -0,0 +1,20 @@
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\appsettings.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\log4net.config
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.ServerHost.deps.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.ServerHost.runtimeconfig.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.ServerHost.runtimeconfig.dev.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.ServerHost.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.ServerHost.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.Data.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.Infrastructure.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.Data.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\bin\Debug\netcoreapp2.2\NSmartProxy.Infrastructure.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.csprojAssemblyReference.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.csproj.CoreCompileInputs.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.AssemblyInfoInputs.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.AssemblyInfo.cs
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.csproj.CopyComplete
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\NSmartProxy.ServerHost\obj\Debug\netcoreapp2.2\NSmartProxy.ServerHost.pdb
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("uProxyServer")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("uProxyServer")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("uProxyServer")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
e2dba229c77c403ec329917346bb32b2418e595d
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
be77396237dadd3b5f87856870a9d0e4ba811749
|
||||
@@ -0,0 +1,32 @@
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\appsettings.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\log4net.config
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csprojAssemblyReference.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csproj.CoreCompileInputs.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.AssemblyInfoInputs.cache
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.AssemblyInfo.cs
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csproj.CopyComplete
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.deps.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.runtimeconfig.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.runtimeconfig.dev.json
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\uProxyServer.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\uProxyServer.pdb
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\Ultron.Proxy.dll
|
||||
D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\Ultron.Proxy.pdb
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csprojAssemblyReference.cache
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csproj.CoreCompileInputs.cache
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.AssemblyInfoInputs.cache
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.AssemblyInfo.cs
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\uProxyServer.dll
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\uProxyServer.pdb
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\appsettings.json
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\log4net.config
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.deps.json
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.runtimeconfig.json
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.runtimeconfig.dev.json
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.dll
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\uProxyServer.pdb
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\Ultron.Proxy.dll
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\bin\Debug\netcoreapp2.2\Ultron.Proxy.pdb
|
||||
D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\Debug\netcoreapp2.2\Ultron.Proxy.Server.csproj.CopyComplete
|
||||
Binary file not shown.
BIN
Ultron.Proxy.Server/obj/Debug/netcoreapp2.2/uProxyServer.dll
Normal file
BIN
Ultron.Proxy.Server/obj/Debug/netcoreapp2.2/uProxyServer.dll
Normal file
Binary file not shown.
BIN
Ultron.Proxy.Server/obj/Debug/netcoreapp2.2/uProxyServer.pdb
Normal file
BIN
Ultron.Proxy.Server/obj/Debug/netcoreapp2.2/uProxyServer.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": 1,
|
||||
"dgSpecHash": "6poK7TDxgT0oLgS4PV6oBfvvgLGaKK4Qz84ptu2+nFlJXXe0kytKrVuWf8cpVNFHln8id5Aitcl572RT5R63YA==",
|
||||
"success": false
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">False</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\MyFiles\Desktop\NSmartProxy\Ultron.Proxy.ServerHost\obj\project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.9.3</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.props" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.props')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("NSmartProxy.ServerHost")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3ecbaab69ba66dfdc86cad622709d33cf5f22de1
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
1d68000cbf672d318ebd4b97356ca652850281b4
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": 1,
|
||||
"dgSpecHash": "hRrR2dBWuq/uLg5mxz4bYT+YQnTkIw3pdVJPTV4J8fEDle8aSAPiAzECzZIEwDDVCaPiUdOH5Id3ICTQzAYb5w==",
|
||||
"success": true
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\MyFiles\Desktop\Ultron.Proxy\Ultron.Proxy.Server\obj\project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.9.3</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.props" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.props')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\build\netcoreapp2.2\Microsoft.NETCore.App.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
5649
Ultron.Proxy.Server/obj/project.assets.json
Normal file
5649
Ultron.Proxy.Server/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user