From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: david@adboyd.com (J. David Boyd) Newsgroups: gmane.emacs.help Subject: Re: ERC through a gateway Date: Wed, 28 Apr 2010 10:47:06 -0400 Message-ID: References: <871vdzoeye.fsf@rimspace.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272466077 18498 80.91.229.12 (28 Apr 2010 14:47:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Apr 2010 14:47:57 +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:47:56 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 1O78YM-0004Ts-Sk for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Apr 2010 16:47:55 +0200 Original-Received: from localhost ([127.0.0.1]:35428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O78YM-0008EJ-DG for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Apr 2010 10:47:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O78Xq-0008Br-HI for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:47:22 -0400 Original-Received: from [140.186.70.92] (port=49651 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O78Xp-0008AJ-CF for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:47:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O78Xo-0005Be-6I for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:47:21 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:42211) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O78Xn-0005BI-SO for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 10:47:20 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O78Xi-00041y-8k for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 16:47:14 +0200 Original-Received: from 198.204.74.254 ([198.204.74.254]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Apr 2010 16:47:14 +0200 Original-Received: from david by 198.204.74.254 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Apr 2010 16:47:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 41 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 198.204.74.254 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (cygwin) Cancel-Lock: sha1:4M35AWasyaKIBdv5kuCFlC8821g= 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:72859 Archived-At: Daniel Pittman writes: > 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 Thanks, lots to learn here, I see, as I have _no_ idea what most of the above does, but I guess I'll figure it out! Dave