/// <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)); }
public Header GetFirstHeader(string name) { GoString res = new GoString(); if (RequestNativeWrapper.RequestGetFirstHeader(requestHandle, GoString.FromString(name), out res)) { return(new Header(name, res.AsString)); } else { return(null); } }
/// <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)); }
public static void SetProxyLogFile(string logFile) { GoString str = GoString.FromString(logFile); SetProxyLogFile(str); }
public bool HeaderExists(string name) { return(RequestNativeWrapper.RequestHeaderExists(requestHandle, GoString.FromString(name))); }
public bool HeaderExists(string name) { return(ResponsetNativeWrapper.ResponseHeaderExists(responseHandle, GoString.FromString(name))); }