Files
TunnelX/AppTunnel/Models/ConnectionStatus.cs
T
MaxFan b311473df4 Add OpenVPN split-tunnel support
Adds external OpenVPN Community integration with split-compatible routing, safer connection readiness checks, profile persistence, UI guidance, and release documentation for the new version.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 15:20:37 +03:30

40 lines
1.2 KiB
C#

namespace AppTunnel.Models;
public enum ConnectionState
{
Disconnected,
Connecting,
Connected,
Disconnecting,
Error
}
public class ConnectionStatus
{
public ConnectionState State { get; set; } = ConnectionState.Disconnected;
public string Message { get; set; } = "آماده اتصال";
public DateTime? ConnectedSince { get; set; }
public string VpnLocalIp { get; set; } = string.Empty;
public string VpnServerIp { get; set; } = string.Empty;
public int VpnServerPort { get; set; }
public string VpnGatewayIp { get; set; } = string.Empty;
public int VpnInterfaceIndex { get; set; } = -1;
/// <summary>
/// Port of the sing-box mixed (SOCKS5/HTTP) inbound, used for accurate
/// end-to-end ping measurement in V2Ray mode.
/// 0 means not applicable (L2TP mode).
/// </summary>
public int SingBoxMixedPort { get; set; } = 0;
public string Duration
{
get
{
if (ConnectedSince == null) return "--:--:--";
var elapsed = DateTime.Now - ConnectedSince.Value;
return $"{(int)elapsed.TotalHours:D2}:{elapsed.Minutes:D2}:{elapsed.Seconds:D2}";
}
}
}