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: Thu, 29 Apr 2010 11:33:12 +1000 Message-ID: <87wrvryrdz.fsf@rimspace.net> References: <871vdzoeye.fsf@rimspace.net> 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 1272504960 29737 80.91.229.12 (29 Apr 2010 01:36:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Apr 2010 01:36:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 29 03:35:59 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 1O7IfW-00079q-Ot for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Apr 2010 03:35:59 +0200 Original-Received: from localhost ([127.0.0.1]:33685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7IfS-00055t-JZ for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Apr 2010 21:35:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7Iee-00050p-7x for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 21:35:04 -0400 Original-Received: from [140.186.70.92] (port=37761 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7Iec-00050h-48 for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 21:35:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7Iea-0007O6-8d for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 21:35:02 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:33267) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7IeZ-0007Nv-Tm for help-gnu-emacs@gnu.org; Wed, 28 Apr 2010 21:35:00 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O7IeY-0006sG-AY for help-gnu-emacs@gnu.org; Thu, 29 Apr 2010 03:34:58 +0200 Original-Received: from sdcarl02.strategicdata.com.au ([203.214.67.82]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Apr 2010 03:34:58 +0200 Original-Received: from daniel by sdcarl02.strategicdata.com.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Apr 2010 03:34:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 49 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sdcarl02.strategicdata.com.au User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:OIRIIzKNN3RQptNdwg2DZvMmy5w= 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:72862 Archived-At: david@adboyd.com (J. David Boyd) writes: > 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) erc uses the function in this variable to establish the connection; it defaults to a function that makes a normal TCP connect, but you can modify it to a bunch of others, or write your own. >> (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))) This just decides between the two connection types based on where it is connecting to; for your purposes, probably not required. >> (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))) This uses ssh to connect to a remote machine, then tunnels TCP/IP to a remote system using netcat. [...] > 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! The built-in help should cover most of what you need. Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons