help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERC through a gateway


From: Daniel Pittman
Subject: Re: ERC through a gateway
Date: Wed, 28 Apr 2010 23:59:37 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

address@hidden (J. David Boyd) writes:
> address@hidden (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            ✉ address@hidden            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons





reply via email to

[Prev in Thread] Current Thread [Next in Thread]