privoxy + ssh forward remote http request to local web serverSSH over Socks proxy without username or...

Is this Android phone Android 9.0 or Android 6.0?

How to say no to more work as a PhD student so I can graduate

Is there a standard way of referencing line numbers in a draft?

Why did Steve Rogers choose this character in Endgame?

If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?

Advice for paying off student loans and auto loans now that I have my first 'real' job

Adjusting vertical spacing in fractions?

Is it OK to use personal email ID for faculty job applications or should we use (current) institute's ID

What made Windows ME so crash-prone?

How to determine the optimal threshold to achieve the highest accuracy

Credit card details stolen every 1-2 years. What am I doing wrong?

What are "full piece" and "half piece" in chess?

What happens on Day 6?

How can I leave a car for someone if we can't meet in person?

Intel 8080-based home computers

A scene of Jimmy diversity

Can a pizza stone be fixed after soap has been used to clean it?

Do I need a 50/60Hz notch filter for battery powered devices?

Finding the package which provides a given command

How to remove the first colon ':' from a timestamp?

What problems was on a lunar module of Apollo 11?

Can a Resident Assistant Be Told to Ignore a Lawful Order?

How to ask my office to remove the pride decorations without appearing anti-LGBTQ?

How to delete certain lists from a nested list?



privoxy + ssh forward remote http request to local web server


SSH over Socks proxy without username or passwordUnable to access an http sevice forwarded using sshRedirect proxy traffic through another IPv4 addressSSH Tunneling - Local and Remote Use CasesSSH - Unable to access local forward from another hostwget probelm with a tunnel connection using sshssh reverse tunnel & gateway ports: forwarding users real (public) IP address?SSH Remote port forwarding with multiple portsssh port forward when connected with ssh in scriptWhat are the relations and differences between port forwarding and proxy?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















My local machine does not have a public IP and the IT department cannot setup an NAT for me, I want to setup a proxy on my remote public server which will forward the request to my local server.



I try using privoxy + ssh, but it says invalid header.



Step 1:
open a ssh tunel by



ssh -nNT -R 8081:localhost:8080 user@example.com


Step 2:
On the remote machine, configure a privoxy config, I tried



forward-socks5 / 127.0.0.1:8081 .
listen-address 0.0.0.0:8080


and



forward / 127.0.0.1:8081
listen-address 0.0.0.0:8080


both said invalid header in browser










share|improve this question
















bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    My local machine does not have a public IP and the IT department cannot setup an NAT for me, I want to setup a proxy on my remote public server which will forward the request to my local server.



    I try using privoxy + ssh, but it says invalid header.



    Step 1:
    open a ssh tunel by



    ssh -nNT -R 8081:localhost:8080 user@example.com


    Step 2:
    On the remote machine, configure a privoxy config, I tried



    forward-socks5 / 127.0.0.1:8081 .
    listen-address 0.0.0.0:8080


    and



    forward / 127.0.0.1:8081
    listen-address 0.0.0.0:8080


    both said invalid header in browser










    share|improve this question
















    bumped to the homepage by Community 2 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      My local machine does not have a public IP and the IT department cannot setup an NAT for me, I want to setup a proxy on my remote public server which will forward the request to my local server.



      I try using privoxy + ssh, but it says invalid header.



      Step 1:
      open a ssh tunel by



      ssh -nNT -R 8081:localhost:8080 user@example.com


      Step 2:
      On the remote machine, configure a privoxy config, I tried



      forward-socks5 / 127.0.0.1:8081 .
      listen-address 0.0.0.0:8080


      and



      forward / 127.0.0.1:8081
      listen-address 0.0.0.0:8080


      both said invalid header in browser










      share|improve this question
















      My local machine does not have a public IP and the IT department cannot setup an NAT for me, I want to setup a proxy on my remote public server which will forward the request to my local server.



      I try using privoxy + ssh, but it says invalid header.



      Step 1:
      open a ssh tunel by



      ssh -nNT -R 8081:localhost:8080 user@example.com


      Step 2:
      On the remote machine, configure a privoxy config, I tried



      forward-socks5 / 127.0.0.1:8081 .
      listen-address 0.0.0.0:8080


      and



      forward / 127.0.0.1:8081
      listen-address 0.0.0.0:8080


      both said invalid header in browser







      ssh proxy privoxy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 15 '16 at 11:49







      cgcgbcbc

















      asked Jul 15 '16 at 11:00









      cgcgbcbccgcgbcbc

      1114 bronze badges




      1114 bronze badges





      bumped to the homepage by Community 2 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          You are not opening any tunnel using:



          ssh -R -nNT 8081:localhost:8080 user@example.com


          but it should fail.



          It should be



          ssh -nNT -R 8081:localhost:8080 user@example.com


          and it is called remote port forwarding.






          share|improve this answer
























          • sorry, that's a typo

            – cgcgbcbc
            Jul 15 '16 at 11:49



















          0














          After some investigation, I found the reason:



          Privoxy is not suitable for such an reverse proxy job,
          and ssh forward can only accept local traffic.



          So there are 2 approaches for solving this problem:




          1. setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)


          2. setup a reverse proxy forwarding request to ssh forwarding port, this can be done through nginx, or write a simple one by oneself, for example, using go:



          e.g.



          package main
          import (
          "net/http/httputil"
          "net/http"
          "net/url"
          "log"
          )

          func main() {
          target, _ := url.Parse("http://localhost:8081")
          proxy := httputil.NewSingleHostReverseProxy(target);
          http.Handle("/", proxy)
          log.Fatal(http.ListenAndServe(":8080", nil))
          }





          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f296098%2fprivoxy-ssh-forward-remote-http-request-to-local-web-server%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You are not opening any tunnel using:



            ssh -R -nNT 8081:localhost:8080 user@example.com


            but it should fail.



            It should be



            ssh -nNT -R 8081:localhost:8080 user@example.com


            and it is called remote port forwarding.






            share|improve this answer
























            • sorry, that's a typo

              – cgcgbcbc
              Jul 15 '16 at 11:49
















            0














            You are not opening any tunnel using:



            ssh -R -nNT 8081:localhost:8080 user@example.com


            but it should fail.



            It should be



            ssh -nNT -R 8081:localhost:8080 user@example.com


            and it is called remote port forwarding.






            share|improve this answer
























            • sorry, that's a typo

              – cgcgbcbc
              Jul 15 '16 at 11:49














            0












            0








            0







            You are not opening any tunnel using:



            ssh -R -nNT 8081:localhost:8080 user@example.com


            but it should fail.



            It should be



            ssh -nNT -R 8081:localhost:8080 user@example.com


            and it is called remote port forwarding.






            share|improve this answer













            You are not opening any tunnel using:



            ssh -R -nNT 8081:localhost:8080 user@example.com


            but it should fail.



            It should be



            ssh -nNT -R 8081:localhost:8080 user@example.com


            and it is called remote port forwarding.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 15 '16 at 11:08









            JakujeJakuje

            16.6k5 gold badges34 silver badges57 bronze badges




            16.6k5 gold badges34 silver badges57 bronze badges













            • sorry, that's a typo

              – cgcgbcbc
              Jul 15 '16 at 11:49



















            • sorry, that's a typo

              – cgcgbcbc
              Jul 15 '16 at 11:49

















            sorry, that's a typo

            – cgcgbcbc
            Jul 15 '16 at 11:49





            sorry, that's a typo

            – cgcgbcbc
            Jul 15 '16 at 11:49













            0














            After some investigation, I found the reason:



            Privoxy is not suitable for such an reverse proxy job,
            and ssh forward can only accept local traffic.



            So there are 2 approaches for solving this problem:




            1. setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)


            2. setup a reverse proxy forwarding request to ssh forwarding port, this can be done through nginx, or write a simple one by oneself, for example, using go:



            e.g.



            package main
            import (
            "net/http/httputil"
            "net/http"
            "net/url"
            "log"
            )

            func main() {
            target, _ := url.Parse("http://localhost:8081")
            proxy := httputil.NewSingleHostReverseProxy(target);
            http.Handle("/", proxy)
            log.Fatal(http.ListenAndServe(":8080", nil))
            }





            share|improve this answer




























              0














              After some investigation, I found the reason:



              Privoxy is not suitable for such an reverse proxy job,
              and ssh forward can only accept local traffic.



              So there are 2 approaches for solving this problem:




              1. setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)


              2. setup a reverse proxy forwarding request to ssh forwarding port, this can be done through nginx, or write a simple one by oneself, for example, using go:



              e.g.



              package main
              import (
              "net/http/httputil"
              "net/http"
              "net/url"
              "log"
              )

              func main() {
              target, _ := url.Parse("http://localhost:8081")
              proxy := httputil.NewSingleHostReverseProxy(target);
              http.Handle("/", proxy)
              log.Fatal(http.ListenAndServe(":8080", nil))
              }





              share|improve this answer


























                0












                0








                0







                After some investigation, I found the reason:



                Privoxy is not suitable for such an reverse proxy job,
                and ssh forward can only accept local traffic.



                So there are 2 approaches for solving this problem:




                1. setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)


                2. setup a reverse proxy forwarding request to ssh forwarding port, this can be done through nginx, or write a simple one by oneself, for example, using go:



                e.g.



                package main
                import (
                "net/http/httputil"
                "net/http"
                "net/url"
                "log"
                )

                func main() {
                target, _ := url.Parse("http://localhost:8081")
                proxy := httputil.NewSingleHostReverseProxy(target);
                http.Handle("/", proxy)
                log.Fatal(http.ListenAndServe(":8080", nil))
                }





                share|improve this answer













                After some investigation, I found the reason:



                Privoxy is not suitable for such an reverse proxy job,
                and ssh forward can only accept local traffic.



                So there are 2 approaches for solving this problem:




                1. setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)


                2. setup a reverse proxy forwarding request to ssh forwarding port, this can be done through nginx, or write a simple one by oneself, for example, using go:



                e.g.



                package main
                import (
                "net/http/httputil"
                "net/http"
                "net/url"
                "log"
                )

                func main() {
                target, _ := url.Parse("http://localhost:8081")
                proxy := httputil.NewSingleHostReverseProxy(target);
                http.Handle("/", proxy)
                log.Fatal(http.ListenAndServe(":8080", nil))
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 15 '16 at 11:59









                cgcgbcbccgcgbcbc

                1114 bronze badges




                1114 bronze badges






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f296098%2fprivoxy-ssh-forward-remote-http-request-to-local-web-server%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







                    Popular posts from this blog

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...