Add DestIpAddress() in Dialer interface

Android client prepares an IP before proxy connection is established. It is useful when connecting to wireguard (or quic) outbound with domain address. E.g. engage.cloudflareclient.com:2408
This commit is contained in:
yuhan6665 committed 2023-12-17 13:15:13 -05:00
1 parent 60b58b68c6
commit 68d12f89ff
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -252,7 +252,7 @@ func NewV2RayPoint(s V2RayVPNServiceSupportsSet, adns bool) *V2RayPoint {
This func will return libv2ray binding version and V2Ray version used.
*/
func CheckVersionX() string {
var version = 25
var version = 26
return fmt.Sprintf("Lib v%d, Xray-core v%s", version, v2core.Version())
}
+4
View File
@@ -276,6 +276,10 @@ func (d *ProtectedDialer) Dial(ctx context.Context,
return d.fdConn(ctx, resolved.IPs[0], resolved.Port, fd)
}
func (d *ProtectedDialer) DestIpAddress() net.IP {
return d.vServer.currentIP()
}
func (d *ProtectedDialer) fdConn(ctx context.Context, ip net.IP, port int, fd int) (net.Conn, error) {
defer unix.Close(fd)