Recently, I've been running a Lisp-based server on a batch scheduling system. The scheduler starts up my server on an available machine and then I'd like to connect to it with Slime. I've noticed two things:
1. The code in swank.lisp listens on port 127.0.0.1 http://127.0.0.1, which means I cannot connect to my Lisp server from a remote machine. I must log in to the host it's running on and then specify "localhost" when I execute slime-connect in Emacs. If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
2. I modified swank.lisp so the server code binds its listening connection socket with foo's address. Now I can connect from a remote machine. Is there any convenient way to send whole files across the Slime connection? The Lisp running the swank server has no NFS access to the machine I'm running Emacs on. I'd like to be able to edit files on the Emacs side and send then whole to the Lisp running swank.
bob
On Sun, 2 Oct 2005 23:54:17 -0400, robert.brown@gmail.com wrote:
If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
Perceived as a potential security hazard.
Is there any convenient way to send whole files across the Slime connection?
You probably need SSH. Watch Marcos Slime movie too, visit www.cliki.net
- The code in swank.lisp listens on port 127.0.0.1, which means I cannot
connect to my Lisp server from a remote machine. I must log in to the host it's running on and then specify "localhost" when I execute slime-connect in Emacs. If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
Well that wold be a huge security hole, you would be running a lisp process anyone can connect to. You should use SSH forwarding if you want to connect to a remote swank.
Like: ssh -L 4005:localhost:4005 my-webserver.com
- I modified swank.lisp so the server code binds its listening connection
socket with foo's address. Now I can connect from a remote machine. Is there
Well - now you have a huge security hole on that server ...
any convenient way to send whole files across the Slime connection? The Lisp running the swank server has no NFS access to the machine I'm running Emacs on. I'd like to be able to edit files on the Emacs side and send then whole to the Lisp running swank.
Well without an NFS mount you can do it by using tramp for GNU Emacs or XEmacs, it should allow you editing files on a remote machine that you have ssh access to. You should set proper: slime-translate-from-lisp-filename-function slime-translate-to-lisp-filename-function So they would convert from tramp filename to the slime relative filename and back.
Ignas
Thanks very much to all who answered my questions. The ssh tunnelling does work. Earlier, it was failing for me, but the cause must have been something else.
I think everyone misinterpreted my second question, however. The server that runs swank does not have any files on it. I suppose I could use tramp to write a file to the server host, and then load it with a separate Lisp command. I was thinking there might be a Slime command that takes a local file, ships it over to the swank machine and then makes the Lisp there compile or load it.
Thanks again.
bob
On 10/3/05, Ignas Mikalajunas ignas.mikalajunas@gmail.com wrote:
- The code in swank.lisp listens on port 127.0.0.1 http://127.0.0.1,
which means I cannot
connect to my Lisp server from a remote machine. I must log in to the
host
it's running on and then specify "localhost" when I execute
slime-connect
in Emacs. If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
Well that wold be a huge security hole, you would be running a lisp process anyone can connect to. You should use SSH forwarding if you want to connect to a remote swank.
Like: ssh -L 4005:localhost:4005 my-webserver.com http://my-webserver.com
- I modified swank.lisp so the server code binds its listening
connection
socket with foo's address. Now I can connect from a remote machine. Is there
Well - now you have a huge security hole on that server ...
any convenient way to send whole files across the Slime connection? The Lisp running the swank server has no NFS access to the machine I'm
running
Emacs on. I'd like to be able to edit files on the Emacs side and send then whole to the Lisp running swank.
Well without an NFS mount you can do it by using tramp for GNU Emacs or XEmacs, it should allow you editing files on a remote machine that you have ssh access to. You should set proper: slime-translate-from-lisp-filename-function slime-translate-to-lisp-filename-function So they would convert from tramp filename to the slime relative filename and back.
Ignas
On 10/3/05, Robert Brown robert.brown@gmail.com wrote:
Thanks very much to all who answered my questions. The ssh tunnelling does work. Earlier, it was failing for me, but the cause must have been something else.
I think everyone misinterpreted my second question, however. The server that runs swank does not have any files on it. I suppose I could use tramp to write a file to the server host, and then load it with a separate Lisp command. I was thinking there might be a Slime command that takes a local file, ships it over to the swank machine and then makes the Lisp there compile or load it.
Not a Slime command, no, but here's an Elisp function that does half the job: Figuring out which remote server you're connected to, where to put the file, etc. would be quite a bit more work, so I'll leave that as an exercise for the reader.
Maybe it *should* be possible to tunnel files over Slime's connection. This way requires SSH access, which might not be granted along with Slime access. (But I can't see any rational reason why not!)
(require 'tramp) (defun save-remotely (buffer machine) (interactive "bSave buffer: \nsTo machine: ") (with-current-buffer buffer (let ((old-location (buffer-file-name))) (write-file (concat "/ssh:" machine ":" (buffer-name))) (setf (buffer-file-name) old-location))))
Robert Brown writes:
Recently, I've been running a Lisp-based server on a batch scheduling system. The scheduler starts up my server on an available machine and then I'd like to connect to it with Slime. I've noticed two things:
- The code in swank.lisp listens on port 127.0.0.1 http://127.0.0.1,
which means I cannot connect to my Lisp server from a remote machine. I must log in to the host it's running on and then specify "localhost" when I execute slime-connect in Emacs. If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
To prevent any random machine on the internet from being able to connect to and control your running Lisp. This is a feature, not a shortcomming; some people use slime to control lisp-based webservers.
- I modified swank.lisp so the server code binds its listening connection
socket with foo's address. Now I can connect from a remote machine. Is there any convenient way to send whole files across the Slime connection? The Lisp running the swank server has no NFS access to the machine I'm running Emacs on. I'd like to be able to edit files on the Emacs side and send then whole to the Lisp running swank.
The normal way to do this is to run the lisp on a remote machine, and ssh to it, tunneling the swank comminications port. You can use a local emacs to edit remote files by using tramp (an emacs package). If you create appropriate functions for slime-translate-from-lisp-filename-function and slime-translate-to-lisp-filename-function, you can use C-c C-k and M-. and all the other slime commands as you normally would.