From 42cb8dfb95d899c1dd0312e499e382ba4beb5040 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Wed, 24 May 2023 17:36:03 -0500 Subject: [PATCH] guri: the default port for SOCKS URLs is 1080 This is true for socks://, socks4://, socks4a://, and socks5://. I could list them individually and risk breaking in the future if socks6:// ever exists, or test for "socks" and risk breaking if a future URL scheme begins with "socks" but doesn't use port 1080. I picked the latter. --- glib/guri.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glib/guri.c b/glib/guri.c index 950becf12..f470ddcb1 100644 --- a/glib/guri.c +++ b/glib/guri.c @@ -820,6 +820,9 @@ default_scheme_port (const char *scheme) if (strcmp (scheme, "ftp") == 0) return 21; + if (strstr (scheme, "socks") == scheme) + return 1080; + return -1; }