Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic
C ccybersecurityhttp3httpproxylinuxlinux-proxymacosmacos-appmacos-proxyproxifierproxifier-alternativeproxyclienttcpthick-clientudpwindivertwindows
removed UDP
Sourav Kalaledfc10e150a2
diff --git a/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeApp.swift b/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeApp.swiftindex 11be1fe..8528b54 100644--- a/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeApp.swift+++ b/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeApp.swift@@ -24,25 +24,30 @@ class ProxyBridgeApp: NSObject {print("ProxyBridge CLI - Starting")+ signal(SIGINT, SIG_IGN)+ signal(SIGTERM, SIG_IGN)+let sigintSource = DispatchSource.makeSignalSource(signal: SIGINT, queue: .main)sigintSource.setEventHandler {print("\nShutting down...")+ fflush(stdout)app.shouldKeepRunning = falseapp.shutdown()CFRunLoopStop(app.runLoop)+ exit(0)}sigintSource.resume()- signal(SIGINT, SIG_IGN)let sigtermSource = DispatchSource.makeSignalSource(signal: SIGTERM, queue: .main)sigtermSource.setEventHandler {print("\nTerminating...")+ fflush(stdout)app.shouldKeepRunning = falseapp.shutdown()CFRunLoopStop(app.runLoop)+ exit(0)}sigtermSource.resume()- signal(SIGTERM, SIG_IGN)app.installExtension()diff --git a/MacOS/ProxyBridge/extension/AppProxyProvider.swift b/MacOS/ProxyBridge/extension/AppProxyProvider.swiftindex 6860597..947919a 100644--- a/MacOS/ProxyBridge/extension/AppProxyProvider.swift+++ b/MacOS/ProxyBridge/extension/AppProxyProvider.swift@@ -83,9 +83,8 @@ class AppProxyProvider: NETransparentProxyProvider {override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {if let tcpFlow = flow as? NEAppProxyTCPFlow {logTCPConnection(tcpFlow)- } else if let udpFlow = flow as? NEAppProxyUDPFlow {- logUDPConnection(udpFlow)}+ // Let all traffic pass through directlyreturn false}@@ -110,27 +109,6 @@ class AppProxyProvider: NETransparentProxyProvider {sendLogToApp(protocol: "TCP", process: processName, destination: destination, port: port)}- private func logUDPConnection(_ flow: NEAppProxyUDPFlow) {- var destination = ""- var port = ""-- if let localEndpoint = flow.localEndpoint,- let localHost = localEndpoint as? NWHostEndpoint {- destination = localHost.hostname- port = localHost.port- } else {- destination = "unknown"- port = "unknown"- }-- var processName = "unknown"- if let metaData = flow.metaData as? NEFlowMetaData {- processName = metaData.sourceAppSigningIdentifier- }-- sendLogToApp(protocol: "UDP", process: processName, destination: destination, port: port)- }-private func sendLogToApp(protocol: String, process: String, destination: String, port: String) {let logData: [String: String] = ["type": "connection",