SiteMap Search ElispArea HowTo Glossary RecentChanges News Problems Suggestions
Cameroon, National Day

ErcProxy

Last edit

Summary: Add info about how to set socks-server variable, as it is non-obvious

Changed:

< The location of the socks server is in the variable `socks-server'.

to

> The location of the socks server is in the variable `socks-server'. To set it you can do:
> (setq socks-server (list "My socks server" "socks-server-hostname" 1080 5))
> Where "My socks server" is the description of the server, "socks-server-hostname" is the host name for the server, 1080 is the port, and 5 is the socks version (can be 4 as well)


We don’t have HTTP proxy support for ERC, yet. But see below for some trivials ways of adding it yourself.

Here’s some background material:

Khmar thinks socks is easier.

aadis says to look how irc-via-proxy is done in the gaim code.

alephnull says: You could run desproxy-socksserver on localhost and tunnel through your HTTP proxy.

ERC through a socks proxy

socks.el comes with Emacs. (Emacs 22 and older can get it from w3.) If you set ‘socks-override-functions’ before loading the library, all the network functions will be using socks:

 (setq socks-override-functions 1)
 (setq socks-noproxy '("localhost"))
 (require 'socks)

Alternatively, you can use the following for ERC only:

 (setq socks-noproxy '("localhost"))
 (require 'socks)
 (setq erc-server-connect-function 'socks-open-network-stream)

The location of the socks server is in the variable ‘socks-server’. To set it you can do:

 (setq socks-server (list "My socks server" "socks-server-hostname" 1080 5))

Where “My socks server” is the description of the server, “socks-server-hostname” is the host name for the server, 1080 is the port, and 5 is the socks version (can be 4 as well)

‘socks-noproxy’ holds a list of regexps for which the network calls are not socksified. I’ve excluded localhost from the connections so that I can still connect to BitlBee.

tor (http://tor.eff.org/)

To use ERC with Tor requires you to have Privoxy installed and configured, as well as the socks.el code from above. In addition, you need to set socks-server with M-x customize-variable RET socks-server RET.

Set the server to “localhost” if you are running Tor/Privoxy on the localhost, or set it to the server where Tor/Privoxy is running. Set the port to “9050”, and select the “Socks v5” radio button.

offby1 just discovered that torify emacs, followed by M-x erc-select, works fine.

Does this solutions leak dns?

Corkscrew

Instead of desproxy, I use corkscrew to tunnel IRC connections through HTTP proxies. Here’s what I do:

 (defun corkscrew-open-network-stream (name buffer host service)
   "Opens a network stream via corkscrew"
   (open-network-stream name buffer host service
                        :type 'shell
                        :shell-command "corkscrew <proxyhost> <proxyport> %s %p"))
 (let ((erc-server-connect-function open-network-stream))
   (erc :server "chat.freenode.net"))

Of course, you want to install corkscrew first. --sthuebner


ERC