检查配置文件参数 WebDomain

This commit is contained in:
SpringHgui 2020-10-27 00:04:01 +08:00
parent 856f19c6a6
commit dc11b4efce

View File

@ -3,6 +3,7 @@ using FastTunnel.Core.Models;
using Microsoft.Extensions.Logging;
using FastTunnel.Core.Handlers.Server;
using System.Collections.Concurrent;
using System;
namespace FastTunnel.Core.Core
{
@ -25,10 +26,21 @@ namespace FastTunnel.Core.Core
public void Run()
{
_logger.LogDebug("FastTunnel Server Start");
CheckSettins();
ListenClient();
ListenHttp();
}
private void CheckSettins()
{
if (string.IsNullOrEmpty(ServerSettings.WebDomain))
{
throw new Exception("[WebDomain] 配置不能为空");
}
}
private void ListenClient()
{
IListener client_listener = new AsyncListener(ServerSettings.BindAddr, ServerSettings.BindPort, _logger);