mirror of
https://github.com/FastTunnel/FastTunnel.git
synced 2025-02-08 02:39:29 +08:00
ServerAddr 支持通过域名
This commit is contained in:
parent
f7f20cc206
commit
7d06a3d709
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"ClientSettings": {
|
||||
"Common": {
|
||||
// 服务端公网ip, 对应服务端配置文件的 BindAddr
|
||||
// 服务端公网ip, 对应服务端配置文件的 BindAddr,支持域名
|
||||
"ServerAddr": "127.0.0.1",
|
||||
|
||||
// 服务端通信端口,对应服务端配置文件的 BindPort
|
||||
|
|
|
@ -10,14 +10,14 @@ namespace FastTunnel.Core
|
|||
{
|
||||
public class Connecter
|
||||
{
|
||||
private string _ip;
|
||||
private string _host;
|
||||
private int _port;
|
||||
|
||||
public Socket Socket { get; set; }
|
||||
|
||||
public Connecter(string v1, int v2, int? sendTimeout = null)
|
||||
{
|
||||
this._ip = v1;
|
||||
this._host = v1;
|
||||
this._port = v2;
|
||||
|
||||
Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
@ -34,10 +34,8 @@ namespace FastTunnel.Core
|
|||
|
||||
public void Connect()
|
||||
{
|
||||
IPAddress ip = IPAddress.Parse(_ip);
|
||||
IPEndPoint point = new IPEndPoint(ip, _port);
|
||||
|
||||
Socket.Connect(point);
|
||||
DnsEndPoint dnsEndPoint = new DnsEndPoint(_host, _port);
|
||||
Socket.Connect(dnsEndPoint);
|
||||
}
|
||||
|
||||
public void Send(byte[] data)
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace FastTunnel.Core.Core
|
|||
return;
|
||||
}
|
||||
|
||||
//LogSuccess(_client.Socket);
|
||||
LogSuccess(_client.Socket);
|
||||
}
|
||||
|
||||
void Close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user