Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
            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);
                }
            }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 5
0
 public bool HeaderExists(string name)
 {
     return(RequestNativeWrapper.RequestHeaderExists(requestHandle, GoString.FromString(name)));
 }
Ejemplo n.º 6
0
 public bool HeaderExists(string name)
 {
     return(ResponsetNativeWrapper.ResponseHeaderExists(responseHandle, GoString.FromString(name)));
 }