proxychains does not work for emacs --daemon
Emacs has daemon mode in the background.
When proxychains emacs --daemon, successive emacsclient does not connect to proxy.
and successive proxychains4 emacsclient ?
For example:
-
$ proxychains emacs --daemon file1.txtAfter editing, close emacs frame.
-
$ emacsclient file2.txtEdit another file2. If trying to access the Internet during the 2nd edition, Emacs/Gnus is dead. No response! Have to
pkill -TERM emacs. -
$ proxychains emacs(without daemon) works like a delightfully. -
Linux 64; proxychains-ng 4.10; Emacs 24.5.
instead of $ emacsclient file2.txt try $ proxychains4 emacsclient file2.txt
Even the 1st step above does not work. Emacs is dead forever if Gnus trying to connect to email.
For proxychains emacsclient file2.txt does not work either.
BTW, it's named proxychains instead of proxychains4.
Is it solved?
Emacs version 26 added the command-line option --fg-daemon, which is compatible with proxychains. So now you can call proxychains -q emacs --fg-daemon.
However, since the emacs process will run in the foreground instead of forking, one might want to use it with a detaching software (abduco, dtach, screen, tmux) or run emacs as a systemd unit.
proxychains emacsclient -a '' -t -c works just fine.