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;
}
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
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.
add a comment |
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
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.
add a comment |
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
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
ssh proxy privoxy
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.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
sorry, that's a typo
– cgcgbcbc
Jul 15 '16 at 11:49
add a comment |
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:
setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)
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))
}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
sorry, that's a typo
– cgcgbcbc
Jul 15 '16 at 11:49
add a comment |
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.
sorry, that's a typo
– cgcgbcbc
Jul 15 '16 at 11:49
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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:
setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)
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))
}
add a comment |
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:
setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)
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))
}
add a comment |
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:
setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)
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))
}
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:
setup iptables rule for tcp forwarding (I'm not professional on this, but I think it's possible)
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))
}
answered Jul 15 '16 at 11:59
cgcgbcbccgcgbcbc
1114 bronze badges
1114 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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