支持在any端口上监听ws
This commit is contained in:
@@ -4,7 +4,7 @@ using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BarrageGrab.JsonEntity;
|
||||
using BarrageGrab.Modles.JsonEntity;
|
||||
using static System.Configuration.ConfigurationManager;
|
||||
namespace BarrageGrab
|
||||
{
|
||||
@@ -24,8 +24,10 @@ namespace BarrageGrab
|
||||
ProxyPort = int.Parse(AppSettings["proxyPort"]);
|
||||
PrintFilter = Enum.GetValues(typeof(BarrageMsgType)).Cast<int>().ToArray();
|
||||
FilterHostName = bool.Parse(AppSettings["filterHostName"].Trim());
|
||||
HostNameFilter = AppSettings["hostNameFilter"].Trim().Split(',').Where(w=>!string.IsNullOrWhiteSpace(w)).ToArray();
|
||||
RoomIds = AppSettings["roomIds"].Trim().Split(',').Where(w=>!string.IsNullOrWhiteSpace(w)).Select(s => long.Parse(s)).ToArray();
|
||||
HostNameFilter = AppSettings["hostNameFilter"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).ToArray();
|
||||
RoomIds = AppSettings["roomIds"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).Select(s => long.Parse(s)).ToArray();
|
||||
UsedProxy = bool.Parse(AppSettings["usedProxy"].Trim());
|
||||
ListenAny = bool.Parse(AppSettings["listenAny"].Trim());
|
||||
|
||||
var printFilter = AppSettings["printFilter"].Trim().ToLower();
|
||||
if (printFilter != "all")
|
||||
@@ -38,9 +40,14 @@ namespace BarrageGrab
|
||||
{
|
||||
Console.WriteLine("配置文件读取失败,请检查配置文件是否正确");
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用系统代理
|
||||
/// </summary>
|
||||
public bool UsedProxy { get; private set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 过滤的进程
|
||||
/// </summary>
|
||||
@@ -49,7 +56,12 @@ namespace BarrageGrab
|
||||
/// <summary>
|
||||
/// 端口号
|
||||
/// </summary>
|
||||
public int WsProt { get; private set; }
|
||||
public int WsProt { get; private set; } = 8888;
|
||||
|
||||
/// <summary>
|
||||
/// true:监听在0.0.0.0,接受任意Ip连接,false:监听在127.0.0.1,仅接受本机连接
|
||||
/// </summary>
|
||||
public bool ListenAny { get; private set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 控制台打印消息开关
|
||||
|
||||
Reference in New Issue
Block a user