From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: bug#16026: Connection specific settings and proxies Date: Thu, 02 Feb 2017 09:46:59 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87o9ykr6os.fsf@flea> References: <86wqjnwa9u.fsf@somewhere.org> <871u1s38m3.fsf@flea.lifelogs.com> <877f5j2i67.fsf@gnus.org> <87a8a8paru.fsf@lifelogs.com> <87r33jnvn1.fsf@lifelogs.com> <87h94fqjq7.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486048392 6513 195.159.176.226 (2 Feb 2017 15:13:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2017 15:13:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 16026@debbugs.gnu.org, Michael Albinus , Stefan Monnier , Emacs developers To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 02 16:13:08 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZJ4N-0001Sv-09 for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 16:13:07 +0100 Original-Received: from localhost ([::1]:57184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZJ4S-0007Vg-DE for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 10:13:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZIfC-0007nb-TW for emacs-devel@gnu.org; Thu, 02 Feb 2017 09:47:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZIf8-0001uk-1U for emacs-devel@gnu.org; Thu, 02 Feb 2017 09:47:06 -0500 Original-Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:32996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZIf7-0001uD-SS for emacs-devel@gnu.org; Thu, 02 Feb 2017 09:47:01 -0500 Original-Received: by mail-qt0-x22b.google.com with SMTP id v23so34062496qtb.0 for ; Thu, 02 Feb 2017 06:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifelogs.com; s=google; h=from:to:cc:subject:organization:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=vne3cVIxoGQNLmOISi0X+iePfHOZoI4fpY8r3BHIKUU=; b=GgtntvS+0bhC52k/mPGoOrasFlWaez1f919rHZ7AxYNe0SOpG///vhTKrx7s8OU60D 3DZ/hkjPx425uhvnDM8DP5j+cNQ6wr1oedcSRtXxrWSboKPMVuSS76BZmreL8kguIise hJ/zb50usWsKMIPVgzgrQu1o6SD75u6SLI93Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :user-agent:mime-version; bh=vne3cVIxoGQNLmOISi0X+iePfHOZoI4fpY8r3BHIKUU=; b=eJrRhQd1TVd8S/az93Y0t10C0G++YMBqcvbZGI/v6lGYmTsf5r94p5DyUpoNARiIcI cg4qAZrs3nQJN2R0u8ofkIGtqdyyMmKz+H7lVh8WJeAiBSqYuwn14wOd6U+3p5OLG2aE BrYyjZbD3asI9Jm1RTrGgpXuxwLIsdVffhuE83wOntCP0GPd8awSywzn7tyrwu5ThqN/ DwN1xtLdQBBlPm9Ji2LgUPz/F+Nv9FJtvwb+I2zupaHZhyN9H9WpBr9rgdEomH0PfGjZ YVfJZ9p1d23WExoxr/HIpbXShRac+KbxJzVvgMZXDzLzoG3jSBe+GE2ER508Yg+qctNN nPEw== X-Gm-Message-State: AIkVDXKCW16ZHqz2DLxS+MO8sJV8Wj8pElI0v+QJQCeuK1cH5nEsESwv0nRPs3qFgViEqw== X-Received: by 10.200.57.163 with SMTP id v32mr8922367qte.173.1486046820916; Thu, 02 Feb 2017 06:47:00 -0800 (PST) Original-Received: from flea (c-98-229-60-157.hsd1.ma.comcast.net. [98.229.60.157]) by smtp.gmail.com with ESMTPSA id h62sm6627883qkc.23.2017.02.02.06.46.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Feb 2017 06:47:00 -0800 (PST) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Lars Ingebrigtsen's message of "Thu, 02 Feb 2017 04:43:10 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211875 Archived-At: On Thu, 02 Feb 2017 04:43:10 +0100 Lars Ingebrigtsen wrote: LI> I'm also not sure what level to put the proxies on: Should they be LI> passed in from the application (i.e., eww, Gnus, etc) or should it be a LI> global Emacs setting? LI> If the latter, you could see having a call like LI> (set-proxy :match-domain ".*\\.foo\\.bar\\'" LI> :target-port 443 LI> :proxy-server "localhost" LI> :proxy-port 80 LI> :method 'connect) LI> to set up the proxy. (Well, really, you'd have a mode that would allow LI> you to tweak the global proxy setup.) The way Michael set it up, you have connection profiles ("classes") that can be associated with any variables. (For passers-by, see `connection-local-set-class-variables', `connection-local-set-classes', and `with-connection-local-classes'). Profiles can be overlaid to augment each other. (Michael: maybe it's not too late to change "class" to "profile" because the former is so overloaded in our field?) LI> And, like I said, I don't know whether it's the right design choice to LI> have these settings be global, or whether they should be passed in LI> explicitly from each application. Would users want to use one set of LI> proxies while reading HTML news from Gnus and another when reading from LI> eww? Perhaps? Perhaps not? I see. I think the classes should be associated with applications and protocols and login names, not just connections. Michael, what do you think? That would require changing the identification parameter to `connection-local-get-classes' to be an alist or a plist like :user U :application X :protocol Y :machine Z I can imagine more criteria in the future, so the identification should be flexible. This has a pretty big semantic overlap with how auth-source selects credentials and NSM applies security polity, so I think it makes sense to absorb those things into the same hierarchy. So IMO this is a chance to consolidate a lot of disparate code and improve the user experience. Then you could have: "class C1(contains the proxy P1) for IMAP to machines A B C" "class C2(contains the proxy P2) for everything" "class C3(contains the proxy P3) for machines B C D" So IMAP to machine B would get C1/P1, but HTTP to machine B would get C3/P3 (all the matching classes should be applied in specificity order so the most specific one wins). Not all parameters apply everywhere, so we're looking to extract the truly global ones first: network timeout, proxies, NSM policy, GnuTLS parameters, auth-source entries. Ted