Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic
C ccybersecurityhttp3httpproxylinuxlinux-proxymacosmacos-appmacos-proxyproxifierproxifier-alternativeproxyclienttcpthick-clientudpwindivertwindows
moved log callback as separate functions - aligned with InterceptSuite code
Sourav Kalal757d4653de0b
diff --git a/src/ProxyBridge.c b/src/ProxyBridge.cindex 91dc9c5..0c4963e 100644--- a/src/ProxyBridge.c+++ b/src/ProxyBridge.c@@ -784,9 +784,6 @@ PROXYBRIDGE_API BOOL ProxyBridge_SetConfig(const ProxyBridgeConfig* config)if (running || config == NULL)return FALSE;- g_log_callback = config->log_callback;- g_connection_callback = config->connection_callback;-if (config->target_process && config->target_process[0] != '\0'){strncpy(g_target_process, config->target_process, MAX_PROCESS_NAME - 1);@@ -803,6 +800,16 @@ PROXYBRIDGE_API BOOL ProxyBridge_SetConfig(const ProxyBridgeConfig* config)return TRUE;}+PROXYBRIDGE_API void ProxyBridge_SetLogCallback(LogCallback callback)+{+ g_log_callback = callback;+}++PROXYBRIDGE_API void ProxyBridge_SetConnectionCallback(ConnectionCallback callback)+{+ g_connection_callback = callback;+}+PROXYBRIDGE_API BOOL ProxyBridge_Start(void){char filter[512];diff --git a/src/ProxyBridge.h b/src/ProxyBridge.hindex 0158669..4856181 100644--- a/src/ProxyBridge.h+++ b/src/ProxyBridge.h@@ -24,14 +24,14 @@ typedef enum {typedef struct {const char* target_process;const char* exclude_process;- LogCallback log_callback;- ConnectionCallback connection_callback;} ProxyBridgeConfig;-PROXYBRIDGE_API BOOL ProxyBridge_Start(void);-PROXYBRIDGE_API BOOL ProxyBridge_Stop(void);PROXYBRIDGE_API BOOL ProxyBridge_SetConfig(const ProxyBridgeConfig* config);PROXYBRIDGE_API BOOL ProxyBridge_SetProxyConfig(ProxyType type, const char* proxy_ip, UINT16 proxy_port);+PROXYBRIDGE_API void ProxyBridge_SetLogCallback(LogCallback callback);+PROXYBRIDGE_API void ProxyBridge_SetConnectionCallback(ConnectionCallback callback);+PROXYBRIDGE_API BOOL ProxyBridge_Start(void);+PROXYBRIDGE_API BOOL ProxyBridge_Stop(void);#ifdef __cplusplus}