From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Making package.el talk over Tor Date: Sat, 09 Dec 2023 09:40:54 +0200 Message-ID: <83y1e3ygah.fsf@gnu.org> References: <8734ybkqf4.fsf@disroot.org> <87sf54q2t8.fsf@posteo.net> <83o7fql10t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, akib@disroot.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 09 08:42:04 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBryM-0003Rz-Tv for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Dec 2023 08:42:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBrxh-0000v2-9D; Sat, 09 Dec 2023 02:41:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBrxf-0000uf-Jp for emacs-devel@gnu.org; Sat, 09 Dec 2023 02:41:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBrxf-0001qp-77; Sat, 09 Dec 2023 02:41:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=7510xcLUryWPc2Srk8r+1ws6NnZMtsXiG3IAWdSITMs=; b=J7XveofLEOhpkV8yLMxM K1HlQXbl1agwRSh1ImQc43fFp768uQBp95WBjvsSlik1Qkdq3eJIfsTbC8n2K8VlwzR0bM4zkxivH kalYZYge7FBRLk3fIXLj65w1KDN/J9Xh4lRbVK/S8hNi4w4E3Q83dFd0IxbC4v+v5FL2FwZA/egD0 ZR1jqKEJXEBMV+4T573p2OEMrsuCMoROFd2ghWxw7pC59pwPhpvkfyKNFS5FC/lMi/WXgHZewY59D lh8yTMhE2Hrvin7HHQ8tItUCPFABBuEK/EvrPSsgWFvbVPQ59eYdbeikgx7/ZVTHA7r2DDkEq0P5Q /8/TkwNUP26+4A==; In-Reply-To: (message from Richard Stallman on Fri, 08 Dec 2023 23:06:38 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:313630 Archived-At: > From: Richard Stallman > Cc: philipk@posteo.net, akib@disroot.org, emacs-devel@gnu.org > Date: Fri, 08 Dec 2023 23:06:38 -0500 > > > > Is this the code you mean? > > > > > > (open-network-stream > > > name buffer host service > > > :type gw-method > > > ;; Use non-blocking socket if we can. > > > :nowait (and (featurep 'make-network-process) > > > (url-asynchronous url-current-object) > > > '(:nowait t))) > > > > How can I make that use TOR? > > > Perhaps the ':type shell' connection is the solution? > > I have no idea. How could I use that to acheieve the goal? I never tried this, and I'm not familiar with TOR, so all I have is what the ELisp manual says where it documents open-network-stream (which is the workhorse of all Emacs commands that use network connections): -- Function: open-network-stream name buffer host service &rest parameters This function opens a TCP connection, with optional encryption, and returns a process object that represents the connection. [...] The remaining arguments PARAMETERS are keyword/argument pairs that are mainly relevant to encrypted connections: [...] ‘:type TYPE’ The type of connection. Options are: ‘plain’ An ordinary, unencrypted connection. ‘tls’ ‘ssl’ A TLS (Transport Layer Security) connection. ‘nil’ ‘network’ Start with a plain connection, and if parameters ‘:success’ and ‘:capability-command’ are supplied, try to upgrade to an encrypted connection via STARTTLS. If that fails, retain the unencrypted connection. ‘starttls’ As for ‘nil’, but if STARTTLS fails drop the connection. ‘shell’ A shell connection. [...] ‘:shell-command STRING-OR-NIL’ If the connection ‘type’ is ‘shell’, this parameter will be interpreted as a format-spec string that will be executed to make the connection. The specs available are ‘%s’ for the host name and ‘%p’ for the port number. For instance, if you want to first ssh to ‘gateway’ before making a plain connection, then this parameter could be something like ‘ssh gateway nc %s %p’. This sounds like a way to make the connection by running a shell command. Maybe you could arrange for using this facility to do what you want? Apologies if this makes no sense to someone who does understand how TOR works; I don't.