unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
To: help-gnu-emacs@gnu.org
Subject: Re: ERC through a gateway
Date: Wed, 28 Apr 2010 23:59:37 +1000	[thread overview]
Message-ID: <871vdzoeye.fsf@rimspace.net> (raw)
In-Reply-To: e8riq7bbwfy.fsf@FLM000025LVE9F.catmktg.com

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





  reply	other threads:[~2010-04-28 13:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-27  8:59 ERC through a gateway Paulo J. Matos
2010-04-28 12:20 ` J. David Boyd
2010-04-28 13:59   ` Daniel Pittman [this message]
2010-04-28 14:47     ` J. David Boyd
2010-04-29  1:33       ` Daniel Pittman
2010-04-29  8:09         ` Paulo J. Matos
2010-04-29  9:58           ` Daniel Pittman
2010-04-30 11:58             ` J. David Boyd
2010-04-30 12:47               ` Peter Dyballa
2010-05-05 15:44                 ` J. David Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vdzoeye.fsf@rimspace.net \
    --to=daniel@rimspace.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).