非windows使用高端口监听反向代理

This commit is contained in:
陈国伟 2021-09-24 10:55:09 +08:00
parent f67fe2e46f
commit cd98c4511b

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Net; using System.Net;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Net.Sockets; using System.Net.Sockets;
@ -23,7 +24,7 @@ namespace FastGithub.Configuration
/// <summary> /// <summary>
/// https端口 /// https端口
/// </summary> /// </summary>
public static int Https { get; } = GetAvailableTcpPort(443); public static int Https { get; } = OperatingSystem.IsWindows() ? GetAvailableTcpPort(443) : GetAvailableTcpPort(48457);
/// <summary> /// <summary>
/// 获取可用的随机Tcp端口 /// 获取可用的随机Tcp端口