managing multiple proxies in linux
I use different proxies for different purposes.
- I use shadowsocks proxy for my general purpose web surfing.
- For going to bank websites, I disable proxy.
- For accessing some websites related to my work, I should use an ssh
tunnel proxy.
So I have a Network Proxy settings GUI opened always and constantly changing between different socks ports when I want to use different websites.
Now I want to define some rules to make proxy switching seamless.
Is there any straightforward way to do it?
proxy iproute socks
add a comment |
I use different proxies for different purposes.
- I use shadowsocks proxy for my general purpose web surfing.
- For going to bank websites, I disable proxy.
- For accessing some websites related to my work, I should use an ssh
tunnel proxy.
So I have a Network Proxy settings GUI opened always and constantly changing between different socks ports when I want to use different websites.
Now I want to define some rules to make proxy switching seamless.
Is there any straightforward way to do it?
proxy iproute socks
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47
add a comment |
I use different proxies for different purposes.
- I use shadowsocks proxy for my general purpose web surfing.
- For going to bank websites, I disable proxy.
- For accessing some websites related to my work, I should use an ssh
tunnel proxy.
So I have a Network Proxy settings GUI opened always and constantly changing between different socks ports when I want to use different websites.
Now I want to define some rules to make proxy switching seamless.
Is there any straightforward way to do it?
proxy iproute socks
I use different proxies for different purposes.
- I use shadowsocks proxy for my general purpose web surfing.
- For going to bank websites, I disable proxy.
- For accessing some websites related to my work, I should use an ssh
tunnel proxy.
So I have a Network Proxy settings GUI opened always and constantly changing between different socks ports when I want to use different websites.
Now I want to define some rules to make proxy switching seamless.
Is there any straightforward way to do it?
proxy iproute socks
proxy iproute socks
asked Feb 14 at 12:41
Mehdi PourfarMehdi Pourfar
1083
1083
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47
add a comment |
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47
add a comment |
1 Answer
1
active
oldest
votes
You can write a proxy.pac
(Proxy Auto Configure) file/script and configure that in your browser to direct what proxy (if any) to use when. It would look something like:
function FindProxyForURL(url, host) {
var socksProxy = "SOCKS ip.of.sock.proxy:port";
var workProxy = "PROXY ip.of.work.proxy:port";
var noProxy = "DIRECT";
if (shExpMatch(host, "*.mybank.example.com")) return noProxy;
if (shExpMatch(host, "*.work.example.net")) return workProxy;
if (host == "other.work.example.net"") return workProxy;
return socksProxy;
}
Of course enter the real IPs and ports of the proxies, and use the correct hostnames.
You can specify the path the this file by starting e.g. Google Chrome with --proxy-pac-url=file:///path/to/proxy.pac
; Chrome on Linux doesn't allow you to directly enter this in the configuration.
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%2f500609%2fmanaging-multiple-proxies-in-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can write a proxy.pac
(Proxy Auto Configure) file/script and configure that in your browser to direct what proxy (if any) to use when. It would look something like:
function FindProxyForURL(url, host) {
var socksProxy = "SOCKS ip.of.sock.proxy:port";
var workProxy = "PROXY ip.of.work.proxy:port";
var noProxy = "DIRECT";
if (shExpMatch(host, "*.mybank.example.com")) return noProxy;
if (shExpMatch(host, "*.work.example.net")) return workProxy;
if (host == "other.work.example.net"") return workProxy;
return socksProxy;
}
Of course enter the real IPs and ports of the proxies, and use the correct hostnames.
You can specify the path the this file by starting e.g. Google Chrome with --proxy-pac-url=file:///path/to/proxy.pac
; Chrome on Linux doesn't allow you to directly enter this in the configuration.
add a comment |
You can write a proxy.pac
(Proxy Auto Configure) file/script and configure that in your browser to direct what proxy (if any) to use when. It would look something like:
function FindProxyForURL(url, host) {
var socksProxy = "SOCKS ip.of.sock.proxy:port";
var workProxy = "PROXY ip.of.work.proxy:port";
var noProxy = "DIRECT";
if (shExpMatch(host, "*.mybank.example.com")) return noProxy;
if (shExpMatch(host, "*.work.example.net")) return workProxy;
if (host == "other.work.example.net"") return workProxy;
return socksProxy;
}
Of course enter the real IPs and ports of the proxies, and use the correct hostnames.
You can specify the path the this file by starting e.g. Google Chrome with --proxy-pac-url=file:///path/to/proxy.pac
; Chrome on Linux doesn't allow you to directly enter this in the configuration.
add a comment |
You can write a proxy.pac
(Proxy Auto Configure) file/script and configure that in your browser to direct what proxy (if any) to use when. It would look something like:
function FindProxyForURL(url, host) {
var socksProxy = "SOCKS ip.of.sock.proxy:port";
var workProxy = "PROXY ip.of.work.proxy:port";
var noProxy = "DIRECT";
if (shExpMatch(host, "*.mybank.example.com")) return noProxy;
if (shExpMatch(host, "*.work.example.net")) return workProxy;
if (host == "other.work.example.net"") return workProxy;
return socksProxy;
}
Of course enter the real IPs and ports of the proxies, and use the correct hostnames.
You can specify the path the this file by starting e.g. Google Chrome with --proxy-pac-url=file:///path/to/proxy.pac
; Chrome on Linux doesn't allow you to directly enter this in the configuration.
You can write a proxy.pac
(Proxy Auto Configure) file/script and configure that in your browser to direct what proxy (if any) to use when. It would look something like:
function FindProxyForURL(url, host) {
var socksProxy = "SOCKS ip.of.sock.proxy:port";
var workProxy = "PROXY ip.of.work.proxy:port";
var noProxy = "DIRECT";
if (shExpMatch(host, "*.mybank.example.com")) return noProxy;
if (shExpMatch(host, "*.work.example.net")) return workProxy;
if (host == "other.work.example.net"") return workProxy;
return socksProxy;
}
Of course enter the real IPs and ports of the proxies, and use the correct hostnames.
You can specify the path the this file by starting e.g. Google Chrome with --proxy-pac-url=file:///path/to/proxy.pac
; Chrome on Linux doesn't allow you to directly enter this in the configuration.
answered Feb 14 at 12:52
wurtelwurtel
10.5k11526
10.5k11526
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%2f500609%2fmanaging-multiple-proxies-in-linux%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
Which GUI do you use? Should the rules be based on target host names?
– Jaleks
Feb 14 at 12:47