From: Simon Nicolussi Date: Sun, 4 Oct 2020 15:17:53 +0000 (+0200) Subject: Access onion services by a SOCKS proxy (e.g., Tor) X-Git-Tag: bookmarks~49 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=46cf826fc554b3d8d9f3a09930b49dd0d58f8230;hp=46cf826fc554b3d8d9f3a09930b49dd0d58f8230;p=elpher.git Access onion services by a SOCKS proxy (e.g., Tor) To test this, start the Tor daemon (tor), set the variable socks-server to the list ("Tor" "localhost" 9050 5), and visit some onion service. The socks library of Emacs provides a (very limited) alternative to the regular open-network-stream function. Some of those limitations can be mitigated by setting the respective options (e.g., the coding system) later on, instead of when creating the network process object. This is now done for both indirect and direct connections, for consistency. TLS is a special case, as the initial connection to the SOCKS server is typically unencrypted: TLS negotiation only takes place after the proxy established a connection to the target. The force-ipv4 option is also a special case, as it is ignored (it obviously cannot work with Tor). The most serious limitation of the socks library is that opening the network stream happens synchronously. For this reason, create the timer before calling socks-open-network-stream. The sentinel function is also not called automatically in the case of a synchronous open, so call it explicitly. The appearance of a hanging Emacs is not ideal (even though users should always be able to abort connection attempts with C-g), but any improvement probably requires changes in the socks library. ---