/// <summary> /// Calls goproxy initalization and loads certificate and key from the specified files. /// </summary> /// <param name="portNumber"></param> /// <param name="certFile">string containing a path to a PEM-encoded certificate file.</param> /// <param name="keyFile">string containing a path to a PEM-encoded key file.</param> public void Init(short httpPortNumber, short httpsPortNumber, string certFile, string keyFile) { onBeforeRequestDelegate = new ProxyNativeWrapper.CallbackDelegate(onBeforeRequest); onBeforeResponseDelegate = new ProxyNativeWrapper.CallbackDelegate(onBeforeResponse); ProxyNativeWrapper.SetOnBeforeRequestCallback(onBeforeRequestDelegate); ProxyNativeWrapper.SetOnBeforeResponseCallback(onBeforeResponseDelegate); ProxyNativeWrapper.Init(httpPortNumber, httpsPortNumber, GoString.FromString(certFile), GoString.FromString(keyFile)); }
/// <summary> /// Calls goproxy initalization and loads certificate and key from the specified files. /// </summary> /// <param name="portNumber"></param> /// <param name="certFile">string containing a path to a PEM-encoded certificate file.</param> /// <param name="keyFile">string containing a path to a PEM-encoded key file.</param> public void Init(short httpPortNumber, short httpsPortNumber, string certFile, string keyFile) { onBeforeRequestDelegate = new ProxyNativeWrapper.CallbackDelegate(onBeforeRequest); onBeforeResponseDelegate = new ProxyNativeWrapper.CallbackDelegate(onBeforeResponse); onBlacklistDelegate = new AdBlockMatcherApi.InternalAdBlockCallbackDelegate(onBlacklist); onWhitelistDelegate = new AdBlockMatcherApi.InternalAdBlockCallbackDelegate(onWhitelist); ProxyNativeWrapper.SetOnBeforeRequestCallback(onBeforeRequestDelegate); ProxyNativeWrapper.SetOnBeforeResponseCallback(onBeforeResponseDelegate); AdBlockMatcherApi.SetBlacklistCallback(onBlacklistDelegate); AdBlockMatcherApi.SetWhitelistCallback(onWhitelistDelegate); ProxyNativeWrapper.Init(httpPortNumber, httpsPortNumber, GoString.FromString(certFile), GoString.FromString(keyFile)); }