예제 #1
0
        public void SetDestPortForLocalPort(int localPort, int destPort)
        {
            if (BitConverter.IsLittleEndian)
            {
                localPort = (ushort)IPAddress.NetworkToHostOrder((short)localPort);
                destPort  = (ushort)IPAddress.NetworkToHostOrder((short)destPort);
            }

            ProxyNativeWrapper.SetDestPortForLocalPort(localPort, destPort);
        }
예제 #2
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));
        }
예제 #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 void SetProxyLogFile(string logFile)
 {
     ProxyNativeWrapper.SetProxyLogFile(logFile);
 }
예제 #5
0
 public void Stop()
 {
     ProxyNativeWrapper.Stop();
 }
예제 #6
0
 public void Start()
 {
     ProxyNativeWrapper.Start();
 }