Fix ServerController return socks5 hostname

This commit is contained in:
ChsBuffer
2021-06-30 13:29:00 +08:00
parent 7d7c91bc68
commit 8c03f7c6db
4 changed files with 8 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Net;
using Netch.Controllers;
using Netch.Interfaces;
using Netch.Models;
@@ -39,7 +40,7 @@ namespace Netch.Servers.Shadowsocks
};
StartGuard(command.ToString());
return new Socks5(this.LocalAddress(), this.Socks5LocalPort());
return new Socks5(IPAddress.Loopback.ToString(), this.Socks5LocalPort());
}
[Verb]

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Net;
using Netch.Controllers;
using Netch.Interfaces;
using Netch.Models;
@@ -42,7 +43,7 @@ namespace Netch.Servers.ShadowsocksR
};
StartGuard(command.ToString());
return new Socks5(this.LocalAddress(), this.Socks5LocalPort());
return new Socks5(IPAddress.Loopback.ToString(), this.Socks5LocalPort());
}
[Verb]

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text.Json;
using Netch.Controllers;
using Netch.Interfaces;
@@ -48,7 +49,7 @@ namespace Netch.Servers
File.WriteAllBytes(Constants.TempConfig, JsonSerializer.SerializeToUtf8Bytes(trojanConfig, Global.NewDefaultJsonSerializerOptions));
StartGuard("-c ..\\data\\last.json");
return new Socks5(this.LocalAddress(), this.Socks5LocalPort());
return new Socks5(IPAddress.Loopback.ToString(), this.Socks5LocalPort());
}
}
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Net;
using Netch.Controllers;
using Netch.Interfaces;
using Netch.Models;
@@ -29,7 +30,7 @@ namespace Netch.Servers
{
File.WriteAllText(Constants.TempConfig, V2rayConfigUtils.GenerateClientConfig(s));
StartGuard("-config ..\\data\\last.json");
return new Socks5(this.LocalAddress(), this.Socks5LocalPort());
return new Socks5(IPAddress.Loopback.ToString(), this.Socks5LocalPort());
}
}
}