From: Karol Skocik
Subject: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140728608.741591.153360@i40g2000cwc.googlegroups.com>
Hi guys,
  I have a problem with connecting to SBCL 0.98 running on our FreeBSD
server.
The server serves as firewall as well, and it looks like that SWANK
wants to open another port (besides the one on 4005) somewhere and we
dont know the where it is. Since we don't want to allow all ports by
default, and want to keep server working as firewall, how to solve
this?

I start SWANK with this :

··@saturn ~ $ cat multi-repl-sbcl
sbcl --load multi-repl-sbcl.lisp

where multi-repl-sbcl.lisp looks like this :

(load "/usr/local/cl-registry/slime/swank-loader")
(swank-loader:load-swank)
(load "/usr/local/cl-registry/slime/present")

(defun start-swank (&key (port swank::default-server-port)
                    (style swank:*communication-style*)
                    (dont-close t))
  "Start the SLIME swank server, listening on PORT.  Multiple
connections are allowed."
  (swank:create-server :port port
                       :style style
                       :dont-close dont-close))
(start-swank)

When I start SBCL like "sbcl --load multi-repl-sbcl.lisp", SWANK is
started and listens on server according to sockstat :

··@Server$ sockstat | grep sbcl
md       sbcl       61826 6  tcp4   127.0.0.1:4005        *:*

So, here is first problem :

-1-  How to setup SWANK to listen on the address of the server
(192.168.0.1) instead of server's localhost address??? (we are
redirecting communication - is it problem?)

Now, I connect to SWANK. I do slime-connect RET 192.168.0.1 RET 4005
RET,
and I get this on the bottom of the Emacs :
error in process filter: connection failed: connection refused,
127.0.0.1, *lisp-output-stream*

Why is the 127.0.0.1 there?

Now, after the attempt to connect, sockstat looks like this :

md       sbcl       61826 5  tcp4   127.0.0.1:4005
192.168.0.50:54812
md       sbcl       61826 6  tcp4   127.0.0.1:4005        *:*
md       sbcl       61826 7  tcp4   127.0.0.1:57255       *:*

so we can see that there is port 57255 on server (127.0.0.1), which is
not allowed, and that's why is probably fails  (maybe.. what's that
another 4005 doing there?)

When I want to close Emacs, I see this process list :

Proc         Status   Buffer         Tty         Command
----         ------   ------         ---         -------
SLIME Lisp   open      *cl-connection* (none)	 (network stream
connection to 192.168.0.1)

What to do? We would really like to use SLIME & SBCL, and connect
remotely, but how to solve this?

Thanks for any ideas,
  Karol

From: Scott Bell
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140729625.045062.207170@p10g2000cwp.googlegroups.com>
Karol,

SLIME binds to your private loopback interface 127.0.0.1. This is done
for security reasons, you most definitely do not want just anyone
connecting to your Lisp with full access to the system. The easiest and
safest way to accomplish a remote connection to a SWANK session is to
use an SSH tunnel to the remote machine.

Hope this helps,

- Scott Bell
From: Karol Skocik
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140740753.763617.314720@i40g2000cwc.googlegroups.com>
Hi,
  Thanks for reply, but how SSH tunnel will help us? The problem seems
to be there, that we don't know the number of port SWANK opens to
communicate (REPL thread on it?) with Emacs, so we cannot tunnel
something which is not known before we connect. I have changed
*loopback-interface* to 192.168.0.1, and changed 127.0.0.1 to
192.168.0.1, but it does not help either.
 Karol
From: Tchavdar Roussanov
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140886126.385701.261490@e56g2000cwe.googlegroups.com>
Karol Skocik wrote:
> Hi,
>   Thanks for reply, but how SSH tunnel will help us? The problem seems
> to be there, that we don't know the number of port SWANK opens to
> communicate (REPL thread on it?) with Emacs, so we cannot tunnel
> something which is not known before we connect. I have changed
> *loopback-interface* to 192.168.0.1, and changed 127.0.0.1 to
> 192.168.0.1, but it does not help either.
>  Karol


(setf swank:*use-dedicated-output-stream* nil)

Cheers
From: Steven E. Harris
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <q94r75tk5hx.fsf@chlorine.gnostech.com>
"Karol Skocik" <············@gmail.com> writes:

> How to setup SWANK to listen on the address of the server
> (192.168.0.1) instead of server's localhost address??? (we are
> redirecting communication - is it problem?)

Look at how swank::*loopback-interface* is used in the code. It's not
an exported variable, but you could experiment with it.

> Now, I connect to SWANK. I do slime-connect RET 192.168.0.1 RET 4005 RET,
> and I get this on the bottom of the Emacs :
> error in process filter: connection failed: connection refused,
> 127.0.0.1, *lisp-output-stream*

Try setting swank:*use-dedicated-output-stream* to nil.

-- 
Steven E. Harris
From: ·············@specastro.com
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140745871.974850.314010@p10g2000cwp.googlegroups.com>
Karol Skocik wrote:
> Hi guys,
>   I have a problem with connecting to SBCL 0.98 running on our FreeBSD
> server.
> The server serves as firewall as well, and it looks like that SWANK
> wants to open another port (besides the one on 4005) somewhere and we
> dont know the where it is. Since we don't want to allow all ports by
> default, and want to keep server working as firewall, how to solve
> this?
>

Karol,

I haven't done this myself, but here's some web links that discuss
SLIME & remote connections.

http://bc.tech.coop/blog/051227.html
http://sandbox.rulemaker.net/ngps/91
http://a1k0n.net/blah/archives/2005/11/04/T18_00_44/index.html
http://article.gmane.org/gmane.lisp.slime.devel/3422/match=remote

You can find a lot of different discussion by searching on "remote" on
www.gmane.org in group gmane.lisp.slime.devel.

Hope they help.

Glenn
From: Karol Skocik
Subject: Re: How to connect with SLIME to remote SBCL?
Date: 
Message-ID: <1140766775.242367.75220@u72g2000cwu.googlegroups.com>
Thanks!
 I am going to check out...
Karol