From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: ERC through a gateway Date: Wed, 28 Apr 2010 23:59:37 +1000 Message-ID: <871vdzoeye.fsf@rimspace.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1272463295 6364 80.91.229.12 (28 Apr 2010 14:01:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Apr 2010 14:01:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 28 16:01:33 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O77pV-0002s2-DI for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Apr 2010 16:01:33 +0200 Original-Received: from localhost ([127.0.0.1]:48227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O77pU-0004DA-QF for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Apr 2010 10:01:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O77p5-0004D5-U1 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:01:07 -0400 Original-Received: from [140.186.70.92] (port=57339 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O77p4-0004Cx-CV for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O77p2-0002Di-D2 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:01:06 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:58525) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O77p2-0002DQ-35 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:01:04 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O77oy-0002Xf-M4 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 16:01:00 +0200 Original-Received: from ppp59-167-189-244.static.internode.on.net ([59.167.189.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Apr 2010 16:01:00 +0200 Original-Received: from daniel by ppp59-167-189-244.static.internode.on.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Apr 2010 16:01:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ppp59-167-189-244.static.internode.on.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:dgifJBvB1xDRyBnCA1Mdtlt8Jh4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72857 Archived-At: david@adboyd.com (J. David Boyd) writes: > pocmatos@gmail.com (Paulo J. Matos) writes: > >> I can only access irc in my company through a gateway. How can I setup erc >> to recognize the gateway? Or if I can't setup erc directly, is there a way >> I can setup machine to direct erc requests through the gateway? > > I would dearly love to know how to do this as well. My company blocks IRC, > and I miss it. ;; Because this is all I really ever use... (setq erc-server-connect-function #'dp/erc-connect-smartly) (defun dp/erc-connect-smartly (name buffer host port) "Establish a connection via SSH, for home, or directly, for normal IRC, which allows me to nicely support multiple concurrent connections." (if (string-match "rimspace\.net$" host) (dp/erc-via-ssh-and-netcat name buffer host port) (open-network-stream name buffer host port))) (defun dp/erc-via-ssh-and-netcat (name buffer host port) "Establish a connection via ssh and netcat on the destination host" (let ((process-connection-type nil) (command (list "/usr/bin/ssh" host "nc" "-q" "1" host (int-to-string port)))) (apply 'start-process name buffer command))) These days I would use the -W option to very recent OpenSSH, but this did the job back in the day. Obviously, season to taste for your own connection style, or write a suitable replacement for the third function, drop the second, etc... Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons