unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ERC through a gateway
@ 2010-04-27  8:59 Paulo J. Matos
  2010-04-28 12:20 ` J. David Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Paulo J. Matos @ 2010-04-27  8:59 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

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?

-- 
PMatos




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  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
  0 siblings, 1 reply; 10+ messages in thread
From: J. David Boyd @ 2010-04-28 12:20 UTC (permalink / raw)
  To: help-gnu-emacs

pocmatos@gmail.com (Paulo J. Matos) writes:

> Hi all,
>
> 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.






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-28 12:20 ` J. David Boyd
@ 2010-04-28 13:59   ` Daniel Pittman
  2010-04-28 14:47     ` J. David Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Pittman @ 2010-04-28 13:59 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-28 13:59   ` Daniel Pittman
@ 2010-04-28 14:47     ` J. David Boyd
  2010-04-29  1:33       ` Daniel Pittman
  0 siblings, 1 reply; 10+ messages in thread
From: J. David Boyd @ 2010-04-28 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

Daniel Pittman <daniel@rimspace.net> 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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-28 14:47     ` J. David Boyd
@ 2010-04-29  1:33       ` Daniel Pittman
  2010-04-29  8:09         ` Paulo J. Matos
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Pittman @ 2010-04-29  1:33 UTC (permalink / raw)
  To: help-gnu-emacs

david@adboyd.com (J. David Boyd) writes:
> Daniel Pittman <daniel@rimspace.net> 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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-29  1:33       ` Daniel Pittman
@ 2010-04-29  8:09         ` Paulo J. Matos
  2010-04-29  9:58           ` Daniel Pittman
  0 siblings, 1 reply; 10+ messages in thread
From: Paulo J. Matos @ 2010-04-29  8:09 UTC (permalink / raw)
  To: Daniel Pittman; +Cc: help-gnu-emacs

Daniel Pittman <daniel@rimspace.net> writes:

>
>>> (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.
>

So, you end up always needing a remote machine that you can ssh to that
provides a way to do a direct tcp/ip connection, right?

-- 
PMatos




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-29  8:09         ` Paulo J. Matos
@ 2010-04-29  9:58           ` Daniel Pittman
  2010-04-30 11:58             ` J. David Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Pittman @ 2010-04-29  9:58 UTC (permalink / raw)
  To: help-gnu-emacs

pocmatos@gmail.com (Paulo J. Matos) writes:
> Daniel Pittman <daniel@rimspace.net> writes:
>
>>>> (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.
>
> So, you end up always needing a remote machine that you can ssh to that
> provides a way to do a direct tcp/ip connection, right?

Well, if you use my command as written you would.  OTOH, you can substitute
*any* command that connects STDIN/STDOUT to a remote TCP socket here, and it
will do the right thing.

So, if you need to tunnel through an HTTP CONNECT gateway get something that
connects that way, and replace the ssh call with that, and bob is your mothers
brother, as the saying goes.


Er, I have been assuming that y'all know how to look up the documentation for
the various customizable variables and so forth.  If not, there is a whole lot
of information about the API for this stuff hidden away there that you could
use to perhaps better understand what is happening.

For how to do that, if you don't know, see the "Documentation Lookup" section
of the info supplied with Emacs, or here:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Documentation.html#Documentation

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-29  9:58           ` Daniel Pittman
@ 2010-04-30 11:58             ` J. David Boyd
  2010-04-30 12:47               ` Peter Dyballa
  0 siblings, 1 reply; 10+ messages in thread
From: J. David Boyd @ 2010-04-30 11:58 UTC (permalink / raw)
  To: help-gnu-emacs



So, I've implemented what I think is the appropriate parts of your code,
now I get this error.   I'm googling for it, but just wondered if you
have ever seen it before?

------------------------------
[Fri Apr 30 2010]
*** irc.freenode.net ssh_askpass: exec(/usr/sbin/ssh-askpass): No such file or
    directory  [07:55]
*** irc.freenode.net Host key verification failed.


Connection failed!  Re-establishing connection...
------------------------------

Any idea what ssh-askpass is?  

Thanks, this will be great when I get it working....

Dave





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-30 11:58             ` J. David Boyd
@ 2010-04-30 12:47               ` Peter Dyballa
  2010-05-05 15:44                 ` J. David Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Dyballa @ 2010-04-30 12:47 UTC (permalink / raw)
  To: J. David Boyd; +Cc: help-gnu-emacs


Am 30.04.2010 um 13:58 schrieb J. David Boyd:

> Any idea what ssh-askpass is?


See maybe here: http://www.jmknoble.net/software/x11-ssh-askpass/.  
This utility is meant to pop up a dialog in which you safely can enter  
your OpenSSH pass phrase. It should also work by disabling this  
external utility and giving GNU Emacs the chance to handle the pass  
phrase. Another software providing it could be a regular OpenSSH  
package: http://www.openssh.com/portable.html. See also here: http://sourceforge.net/projects/nps-ssh-askpass/ 
.

--
Greetings

   Pete

"Debugging? Klingons do not debug! Our software does not coddle the  
weak."





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ERC through a gateway
  2010-04-30 12:47               ` Peter Dyballa
@ 2010-05-05 15:44                 ` J. David Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: J. David Boyd @ 2010-05-05 15:44 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 30.04.2010 um 13:58 schrieb J. David Boyd:
>
>> Any idea what ssh-askpass is?
>
>
> See maybe here:
> http://www.jmknoble.net/software/x11-ssh-askpass/. This utility is
> meant to pop up a dialog in which you safely can enter  your OpenSSH
> pass phrase. It should also work by disabling this  external utility
> and giving GNU Emacs the chance to handle the pass  phrase. Another
> software providing it could be a regular OpenSSH  package:
> http://www.openssh.com/portable.html. See also here:
> http://sourceforge.net/projects/nps-ssh-askpass/ .
>
> --
> Greetings
>
>   Pete
>
> "Debugging? Klingons do not debug! Our software does not coddle the
> weak."


Any idea how to set up emacs to NOT call that?  I've looked through the
docs, etc, and still have no idea.  

Dave





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-05 15:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).