Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic
C ccybersecurityhttp3httpproxylinuxlinux-proxymacosmacos-appmacos-proxyproxifierproxifier-alternativeproxyclienttcpthick-clientudpwindivertwindows
#49 - WIP - Improved logging size
Sourav Kalald8289c3ef55d
diff --git a/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeViewModel.swift b/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeViewModel.swiftindex 41222dd..c96ee57 100644--- a/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeViewModel.swift+++ b/MacOS/ProxyBridge/ProxyBridge/ProxyBridgeViewModel.swift@@ -193,17 +193,20 @@ class ProxyBridgeViewModel: NSObject, ObservableObject {try? session.sendProviderMessage(data) { [weak self] response inguard let self = self,- let responseData = response,- let log = try? JSONSerialization.jsonObject(with: responseData) as? [String: String] else {+ let responseData = response else {return}- DispatchQueue.main.async {- if log["type"] == "connection" {- self.handleConnectionLog(log)- } else {- self.handleActivityLog(log)- }+ if let logs = try? JSONSerialization.jsonObject(with: responseData) as? [[String: String]] {+ DispatchQueue.main.async {+ for log in logs {+ if log["type"] == "connection" {+ self.handleConnectionLog(log)+ } else {+ self.handleActivityLog(log)+ }+ }+ }}}}diff --git a/MacOS/ProxyBridge/build.sh b/MacOS/ProxyBridge/build.shindex 8fd25d5..4a588b7 100755--- a/MacOS/ProxyBridge/build.sh+++ b/MacOS/ProxyBridge/build.sh@@ -3,26 +3,19 @@set -eSCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+APP_PATH="$SCRIPT_DIR/output/ProxyBridge.app"-rm -rf "$SCRIPT_DIR/output"-mkdir -p "$SCRIPT_DIR/output"+if [ ! -d "$APP_PATH" ]; then+ echo "Error: ProxyBridge.app not found in output directory"+ echo "Export the app from Xcode to output/ first"+ exit 1+fi-xcodebuild \- -project ProxyBridge.xcodeproj \- -scheme ProxyBridge \- -configuration Release \- -derivedDataPath build/DerivedData \- ARCHS="arm64 x86_64" \- ONLY_ACTIVE_ARCH=NO \- CODE_SIGN_IDENTITY="-" \- CODE_SIGNING_REQUIRED=NO \- CODE_SIGNING_ALLOWED=NO \- clean build+mkdir -p "$SCRIPT_DIR/build/component"-cp -R build/DerivedData/Build/Products/Release/ProxyBridge.app output/+cp -R "$APP_PATH" "$SCRIPT_DIR/build/component/"-mkdir -p build/component-cp -R output/ProxyBridge.app build/component/+echo "Creating installer package..."pkgbuild \--root build/component \@@ -55,6 +48,23 @@ productbuild \--package-path build \output/ProxyBridge-Installer.pkg+echo "Package created: output/ProxyBridge-Installer.pkg"++if [ -n "$APPLE_ID" ] && [ -n "$APPLE_APP_PASSWORD" ]; then+ echo "Notarizing installer..."+ xcrun notarytool submit output/ProxyBridge-Installer.pkg \+ --apple-id "$APPLE_ID" \+ --team-id "L4HJT32Z59" \+ --password "$APPLE_APP_PASSWORD" \+ --wait++ echo "Stapling notarization ticket..."+ xcrun stapler staple output/ProxyBridge-Installer.pkg+ echo "Installer notarized"+else+ echo "Skipping notarization - set APPLE_ID and APPLE_APP_PASSWORD to notarize"+fi+rm -rf buildecho "✓ Build complete"diff --git a/MacOS/ProxyBridge/extension/AppProxyProvider.swift b/MacOS/ProxyBridge/extension/AppProxyProvider.swiftindex 3351101..9e11800 100644--- a/MacOS/ProxyBridge/extension/AppProxyProvider.swift+++ b/MacOS/ProxyBridge/extension/AppProxyProvider.swift@@ -253,9 +253,10 @@ class AppProxyProvider: NETransparentProxyProvider {case "getLogs":logQueueLock.lock()if !logQueue.isEmpty {- let logEntry = logQueue.removeFirst()+ let logsToSend = Array(logQueue.prefix(min(100, logQueue.count)))+ logQueue.removeFirst(logsToSend.count)logQueueLock.unlock()- completionHandler?(try? JSONSerialization.data(withJSONObject: logEntry))+ completionHandler?(try? JSONSerialization.data(withJSONObject: logsToSend))} else {logQueueLock.unlock()completionHandler?(nil)