コード例 #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));
        }
コード例 #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);
                }
            }
コード例 #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));
        }
コード例 #4
0
        public static void SetProxyLogFile(string logFile)
        {
            GoString str = GoString.FromString(logFile);

            SetProxyLogFile(str);
        }
コード例 #5
0
 public bool HeaderExists(string name)
 {
     return(RequestNativeWrapper.RequestHeaderExists(requestHandle, GoString.FromString(name)));
 }
コード例 #6
0
 public bool HeaderExists(string name)
 {
     return(ResponsetNativeWrapper.ResponseHeaderExists(responseHandle, GoString.FromString(name)));
 }