GNOME Bugzilla – Bug 698163
proxy-resolver not working with port 80
Last modified: 2013-04-26 11:17:47 UTC
I am using libsoup 2.42.0, glib 2.36.0, and the new proxy-resolver feature to connect to tor/socks5 directly. However, port 80 doesn't seem to work with xombrero/webkit. I have written a small app to demonstrate. #include <libsoup/soup.h> #include <stdio.h> #include <stdlib.h> int main(void) { GProxyResolver *r; SoupSession *s; SoupMessage *msg; guint status; int i; char *hosts[] = { "http://www.google.com", "https://www.google.com", "http://www.google.com:80", "http://labs.webmetrics.com:8080" }; r = g_simple_proxy_resolver_new("socks5://127.0.0.1:9050", NULL); s = soup_session_new(); g_object_set(s, "proxy-resolver", r, NULL); for (i = 0; i < sizeof(hosts) / sizeof(hosts[0]); i++) { msg = soup_message_new("GET", hosts[i]); status = soup_session_send_message(s, msg); printf("%s: soup:%s http:%d\n", hosts[i], soup_status_get_phrase(status), msg->status_code); } return (0); } http://www.google.com: soup:Cannot connect to destination http:4 https://www.google.com: soup:OK http:200 http://www.google.com:80: soup:Cannot connect to destination http:4 http://labs.webmetrics.com:8080: soup:OK http:200 On the first and third test (port 80 tests), Tor says: Tor[17353]: Application asked to connect to port 0. Refusing. Seems like libsoup or gio is ignoring setting the port number if it is supposed to be 80?
Created attachment 241789 [details] [review] Patch This fixes the issue by just setting the port.
Fixed in git. Thanks for the patch, though it wasn't quite right; we can't make soup_uri_to_string() include the port number unconditionally, because that would break other things. So I added a new internal helper so we can force it to get added just in this case.
Is this worth a 2.42.2 release?
2.42.2 will be with GNOME 3.8.2, but that's almost a month away, so maybe it's worth doing a 2.42.1.1...
no objection here. would be much appreciated.
2.42.2 is now tagged in git and available on ftp.gnome.org
*** Bug 698877 has been marked as a duplicate of this bug. ***