不强制结束占用22和80端口的进程

This commit is contained in:
xljiulang 2021-08-14 17:03:12 +08:00
parent a73a01662a
commit 7f00d312ca

View File

@ -23,11 +23,6 @@ namespace FastGithub
public static void ListenHttpReverseProxy(this KestrelServerOptions kestrel) public static void ListenHttpReverseProxy(this KestrelServerOptions kestrel)
{ {
const int HTTP_PORT = 80; const int HTTP_PORT = 80;
if (OperatingSystem.IsWindows())
{
TcpTable.KillPortOwner(HTTP_PORT);
}
if (LocalMachine.CanListenTcp(HTTP_PORT) == false) if (LocalMachine.CanListenTcp(HTTP_PORT) == false)
{ {
var loggerFactory = kestrel.ApplicationServices.GetRequiredService<ILoggerFactory>(); var loggerFactory = kestrel.ApplicationServices.GetRequiredService<ILoggerFactory>();
@ -78,11 +73,6 @@ namespace FastGithub
public static void ListenGithubSshProxy(this KestrelServerOptions kestrel) public static void ListenGithubSshProxy(this KestrelServerOptions kestrel)
{ {
const int SSH_PORT = 22; const int SSH_PORT = 22;
if (OperatingSystem.IsWindows())
{
TcpTable.KillPortOwner(SSH_PORT);
}
if (LocalMachine.CanListenTcp(SSH_PORT) == false) if (LocalMachine.CanListenTcp(SSH_PORT) == false)
{ {
var loggerFactory = kestrel.ApplicationServices.GetRequiredService<ILoggerFactory>(); var loggerFactory = kestrel.ApplicationServices.GetRequiredService<ILoggerFactory>();