Filtering on Top of Already Developed Proxy





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I'm currently trying to design a filter that with it I can block certain URLs and also
block based on keywords that may be at the data that came back from the http response.



Just for clarification I'm working on a Windows 10 x64 machine for this project.



In order to be able to do such thing, I quickly understood that I would need a web proxy.
I checked out about 6 proxies written in python that I found on github.



These are the project I tried to use (some are Python3 some 2):



https://github.com/abhinavsingh/proxy.py/blob/develop/proxy.py
https://github.com/inaz2/proxy2/blob/master/proxy2.py
https://github.com/inaz2/SimpleHTTPProxy - this one is the earlier version of the top one
https://github.com/FeeiCN/WebProxy


Abhinavsingh's Proxy (first in the list):



what I want to happen



I want the proxy to be able to block sites based on the requests and the content came back, I also need the filter to be in a separated file and to be generic
so I can apply it on every site and every request/response.



I'd like understand where is the correct place to put a filter on this proxy
and how to do redirect or just send a block page back when the client tries to access
sites that has specific urls, or when the response is a page that contains some keywords.



what I tried



I enabled the proxy on google chrome's 'Open proxy settings'
and executed the script. It looked pretty promising, and I noticed that I can insert a filterer's function call in line 383 at the _process_request function so that I can return
to it maybe another host to redirect to or just block. It worked partially for me.



The problems



First of all, I couldn't fully redirect/block the sites. Sometimes it worked, Sometimes it
didn't.
Another problem I ran into was that I realized that I can't access the content of site that returned, if it is https.



Also, filter the response was unfortunately not clear for me.



I noticed also that proxy2 (the second in the list) can solve that problem I had
of filtering https page's content, but I couldn't find out how to make this feature work (and also I think it requires linux utilities anyhow).



The process I described above was pretty much the one that I tried to work on every proxy in the list. At some proxies, like proxy2.py I couldn't understand at all what I needed to do.



If anybody managed to make a filter on top of this proxy or any other from this list and can help me understand how to do it, I'll be grateful if you'll comment down below.



Thank you.










share|improve this question





























    0















    I'm currently trying to design a filter that with it I can block certain URLs and also
    block based on keywords that may be at the data that came back from the http response.



    Just for clarification I'm working on a Windows 10 x64 machine for this project.



    In order to be able to do such thing, I quickly understood that I would need a web proxy.
    I checked out about 6 proxies written in python that I found on github.



    These are the project I tried to use (some are Python3 some 2):



    https://github.com/abhinavsingh/proxy.py/blob/develop/proxy.py
    https://github.com/inaz2/proxy2/blob/master/proxy2.py
    https://github.com/inaz2/SimpleHTTPProxy - this one is the earlier version of the top one
    https://github.com/FeeiCN/WebProxy


    Abhinavsingh's Proxy (first in the list):



    what I want to happen



    I want the proxy to be able to block sites based on the requests and the content came back, I also need the filter to be in a separated file and to be generic
    so I can apply it on every site and every request/response.



    I'd like understand where is the correct place to put a filter on this proxy
    and how to do redirect or just send a block page back when the client tries to access
    sites that has specific urls, or when the response is a page that contains some keywords.



    what I tried



    I enabled the proxy on google chrome's 'Open proxy settings'
    and executed the script. It looked pretty promising, and I noticed that I can insert a filterer's function call in line 383 at the _process_request function so that I can return
    to it maybe another host to redirect to or just block. It worked partially for me.



    The problems



    First of all, I couldn't fully redirect/block the sites. Sometimes it worked, Sometimes it
    didn't.
    Another problem I ran into was that I realized that I can't access the content of site that returned, if it is https.



    Also, filter the response was unfortunately not clear for me.



    I noticed also that proxy2 (the second in the list) can solve that problem I had
    of filtering https page's content, but I couldn't find out how to make this feature work (and also I think it requires linux utilities anyhow).



    The process I described above was pretty much the one that I tried to work on every proxy in the list. At some proxies, like proxy2.py I couldn't understand at all what I needed to do.



    If anybody managed to make a filter on top of this proxy or any other from this list and can help me understand how to do it, I'll be grateful if you'll comment down below.



    Thank you.










    share|improve this question

























      0












      0








      0








      I'm currently trying to design a filter that with it I can block certain URLs and also
      block based on keywords that may be at the data that came back from the http response.



      Just for clarification I'm working on a Windows 10 x64 machine for this project.



      In order to be able to do such thing, I quickly understood that I would need a web proxy.
      I checked out about 6 proxies written in python that I found on github.



      These are the project I tried to use (some are Python3 some 2):



      https://github.com/abhinavsingh/proxy.py/blob/develop/proxy.py
      https://github.com/inaz2/proxy2/blob/master/proxy2.py
      https://github.com/inaz2/SimpleHTTPProxy - this one is the earlier version of the top one
      https://github.com/FeeiCN/WebProxy


      Abhinavsingh's Proxy (first in the list):



      what I want to happen



      I want the proxy to be able to block sites based on the requests and the content came back, I also need the filter to be in a separated file and to be generic
      so I can apply it on every site and every request/response.



      I'd like understand where is the correct place to put a filter on this proxy
      and how to do redirect or just send a block page back when the client tries to access
      sites that has specific urls, or when the response is a page that contains some keywords.



      what I tried



      I enabled the proxy on google chrome's 'Open proxy settings'
      and executed the script. It looked pretty promising, and I noticed that I can insert a filterer's function call in line 383 at the _process_request function so that I can return
      to it maybe another host to redirect to or just block. It worked partially for me.



      The problems



      First of all, I couldn't fully redirect/block the sites. Sometimes it worked, Sometimes it
      didn't.
      Another problem I ran into was that I realized that I can't access the content of site that returned, if it is https.



      Also, filter the response was unfortunately not clear for me.



      I noticed also that proxy2 (the second in the list) can solve that problem I had
      of filtering https page's content, but I couldn't find out how to make this feature work (and also I think it requires linux utilities anyhow).



      The process I described above was pretty much the one that I tried to work on every proxy in the list. At some proxies, like proxy2.py I couldn't understand at all what I needed to do.



      If anybody managed to make a filter on top of this proxy or any other from this list and can help me understand how to do it, I'll be grateful if you'll comment down below.



      Thank you.










      share|improve this question














      I'm currently trying to design a filter that with it I can block certain URLs and also
      block based on keywords that may be at the data that came back from the http response.



      Just for clarification I'm working on a Windows 10 x64 machine for this project.



      In order to be able to do such thing, I quickly understood that I would need a web proxy.
      I checked out about 6 proxies written in python that I found on github.



      These are the project I tried to use (some are Python3 some 2):



      https://github.com/abhinavsingh/proxy.py/blob/develop/proxy.py
      https://github.com/inaz2/proxy2/blob/master/proxy2.py
      https://github.com/inaz2/SimpleHTTPProxy - this one is the earlier version of the top one
      https://github.com/FeeiCN/WebProxy


      Abhinavsingh's Proxy (first in the list):



      what I want to happen



      I want the proxy to be able to block sites based on the requests and the content came back, I also need the filter to be in a separated file and to be generic
      so I can apply it on every site and every request/response.



      I'd like understand where is the correct place to put a filter on this proxy
      and how to do redirect or just send a block page back when the client tries to access
      sites that has specific urls, or when the response is a page that contains some keywords.



      what I tried



      I enabled the proxy on google chrome's 'Open proxy settings'
      and executed the script. It looked pretty promising, and I noticed that I can insert a filterer's function call in line 383 at the _process_request function so that I can return
      to it maybe another host to redirect to or just block. It worked partially for me.



      The problems



      First of all, I couldn't fully redirect/block the sites. Sometimes it worked, Sometimes it
      didn't.
      Another problem I ran into was that I realized that I can't access the content of site that returned, if it is https.



      Also, filter the response was unfortunately not clear for me.



      I noticed also that proxy2 (the second in the list) can solve that problem I had
      of filtering https page's content, but I couldn't find out how to make this feature work (and also I think it requires linux utilities anyhow).



      The process I described above was pretty much the one that I tried to work on every proxy in the list. At some proxies, like proxy2.py I couldn't understand at all what I needed to do.



      If anybody managed to make a filter on top of this proxy or any other from this list and can help me understand how to do it, I'll be grateful if you'll comment down below.



      Thank you.







      python https filtering http-proxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 9:51









      M. BoggioM. Boggio

      13




      13
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456993%2ffiltering-on-top-of-already-developed-proxy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456993%2ffiltering-on-top-of-already-developed-proxy%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini