public static Socks5Response FromRequest(Socks5Request request, IPEndPoint bindedEndPoint) { var resp = new Socks5Response { Version = request.Version, Response = SocksResponse.SUCCESS, RSV = request.RSV, Remote = new SocksRemote() { AddressType = bindedEndPoint.AddressFamily == AddressFamily.InterNetworkV6 ? SocksAddressType.IPV6 : SocksAddressType.IPV4, Address = AddressUtils.GetVaildLocalIpAddress(bindedEndPoint), Port = (ushort)bindedEndPoint.Port, } }; return(resp); }