diff --git a/ios-proxy-app/whitelist-bypass-proxy/ContentView.swift b/ios-proxy-app/whitelist-bypass-proxy/ContentView.swift index b8ea26c..c1d9741 100644 --- a/ios-proxy-app/whitelist-bypass-proxy/ContentView.swift +++ b/ios-proxy-app/whitelist-bypass-proxy/ContentView.swift @@ -50,6 +50,14 @@ struct ContentView: View { if proxyManager.status == .tunnelConnected { ProxyInfoView(proxyUrl: proxyManager.socksUrl, onCopy: proxyManager.copyProxyUrl) + Button(action: { proxyManager.openHappProxy() }) { + Label(NSLocalizedString("btn_open_in_happ", comment: ""), systemImage: "globe") + .frame(maxWidth: .infinity) + } + .buttonStyle(.borderedProminent) + .tint(.purple) + .padding(.horizontal) + Button(action: { proxyManager.openTelegramProxy() }) { Label(NSLocalizedString("btn_open_in_telegram", comment: ""), systemImage: "paperplane.fill") .frame(maxWidth: .infinity) diff --git a/ios-proxy-app/whitelist-bypass-proxy/Localizable.strings b/ios-proxy-app/whitelist-bypass-proxy/Localizable.strings index d520b29..3300931 100644 --- a/ios-proxy-app/whitelist-bypass-proxy/Localizable.strings +++ b/ios-proxy-app/whitelist-bypass-proxy/Localizable.strings @@ -8,6 +8,7 @@ "btn_stop" = "Stop"; "btn_go" = "Go"; "btn_done" = "Done"; +"btn_open_in_happ" = "Copy v2ray URL"; "btn_open_in_telegram" = "Open in Telegram"; "hint_call_link" = "VK / Telemost link or wbstream://"; "hint_username" = "Username"; @@ -28,4 +29,5 @@ "settings_vp8_fps" = "FPS"; "settings_vp8_batch" = "Batch"; "proxy_url_copied" = "Proxy URL copied"; +"toast_happ_params_copied" = "v2ray URL copied"; "dc_mode_not_supported" = "DC mode not supported - falling back to video"; diff --git a/ios-proxy-app/whitelist-bypass-proxy/ProxyManager.swift b/ios-proxy-app/whitelist-bypass-proxy/ProxyManager.swift index 97cc4dc..f8c14c5 100644 --- a/ios-proxy-app/whitelist-bypass-proxy/ProxyManager.swift +++ b/ios-proxy-app/whitelist-bypass-proxy/ProxyManager.swift @@ -401,4 +401,12 @@ class ProxyManager: ObservableObject { } } + func openHappProxy() { + let creds = "\(activeSocksUser):\(activeSocksPass)" + let credsB64 = Data(creds.utf8).base64EncodedString() + let proxyUri = "socks://\(credsB64)@127.0.0.1:\(socksPort)#WLB-\(socksPort)" + UIPasteboard.general.string = proxyUri + showToast(NSLocalizedString("toast_happ_params_copied", comment: "")) + } + }