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: Thu, 29 Apr 2010 11:33:12 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

address@hidden (J. David Boyd) writes:
> Daniel Pittman <address@hidden> writes:
>> 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)

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            ✉ 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]