summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorGhostAV <ghostav@riseup.net>2015-08-18 12:46:34 +0200
committerChristoph Lohmann <20h@r-36.net>2015-08-18 17:43:18 +0200
commit957a6f0812bbc7140b89219de68458c715f35999 (patch)
tree52af20ecf5f853d4c41fcf548a254820d2a15627 /surf.c
parent9b6998e7ae06ef4df14f84a902c24c49c0968a1d (diff)
downloadsurf-957a6f0812bbc7140b89219de68458c715f35999.tar.gz
surf-957a6f0812bbc7140b89219de68458c715f35999.tar.bz2
surf-957a6f0812bbc7140b89219de68458c715f35999.zip
Torified surf is unstable
On Tue, Aug 18, 2015 at 12:38:40PM +0200, Gabriel PĂ©rez-Cerezo wrote: > It really seems to be a problem with torsocks. I have already solved > this problem with a patch GhostAV just sent me on this list that adds > SOCKS support to surf. It works fine now. As i failed to send the patch to the list, i resend it now: -- >8 -- From: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de> Subject: [PATCH] allow sock proxies Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/surf.c b/surf.c
index 87c10ef..02656ec 100644
--- a/surf.c
+++ b/surf.c
@@ -1270,8 +1270,12 @@ setup(void) {
/* proxy */
if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) {
- new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) :
- g_strdup_printf("http://%s", proxy);
+ new_proxy = g_strrstr(proxy, "http://")
+ || g_strrstr(proxy, "socks://")
+ || g_strrstr(proxy, "socks4://")
+ || g_strrstr(proxy, "socks5://")
+ ? g_strdup(proxy)
+ : g_strdup_printf("http://%s", proxy);
puri = soup_uri_new(new_proxy);
g_object_set(G_OBJECT(s), "proxy-uri", puri, NULL);
soup_uri_free(puri);