2
0
Эх сурвалжийг харах

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

陈国伟 3 жил өмнө
parent
commit
cd98c4511b

+ 3 - 2
FastGithub.Configuration/ReverseProxyPort.cs

@@ -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端口