diff --git a/IVPNClient/Scenes/ViewControllers/AddCustomPortViewController.swift b/IVPNClient/Scenes/ViewControllers/AddCustomPortViewController.swift index 58c15c1c3..3a9a46055 100644 --- a/IVPNClient/Scenes/ViewControllers/AddCustomPortViewController.swift +++ b/IVPNClient/Scenes/ViewControllers/AddCustomPortViewController.swift @@ -78,6 +78,7 @@ class AddCustomPortViewController: UITableViewController { super.viewDidLoad() updateSelectedPortRange() typeControl.isEnabled = Application.shared.settings.connectionProtocol.tunnelType() == .openvpn + typeControl.selectedSegmentIndex = UserDefaults.shared.isV2ray && UserDefaults.shared.v2rayProtocol == "tcp" && Application.shared.settings.connectionProtocol.tunnelType() == .wireguard ? 1 : 0 } // MARK: - Methods - diff --git a/IVPNClient/Scenes/ViewControllers/PortViewController.swift b/IVPNClient/Scenes/ViewControllers/PortViewController.swift index 40bfa08f1..415eda18d 100644 --- a/IVPNClient/Scenes/ViewControllers/PortViewController.swift +++ b/IVPNClient/Scenes/ViewControllers/PortViewController.swift @@ -45,6 +45,10 @@ class PortViewController: UITableViewController { continue } + if !UserDefaults.shared.isV2ray && Application.shared.settings.connectionProtocol.tunnelType() == .wireguard && customPort.type == "tcp" { + continue + } + let string = "\(customPort.vpnProtocol ?? "")-\(customPort.type ?? "")-\(customPort.port)" ports.append(ConnectionSettings.getFrom(portString: string)) }