mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
Update jupyter-make-ssh-tunnel
* jupyter-base.el (jupyter-make-ssh-tunnel): Rename arguments for clarity. Change argument ordering to be the same as the ssh command invocation, update all callers.
This commit is contained in:
parent
44683dd1f0
commit
075a3a5f17
1 changed files with 7 additions and 5 deletions
|
@ -486,8 +486,10 @@ following fields:
|
||||||
finally return (mapcar (lambda (p) (cadr (process-contact p))) servers))
|
finally return (mapcar (lambda (p) (cadr (process-contact p))) servers))
|
||||||
(mapc #'delete-process servers))))
|
(mapc #'delete-process servers))))
|
||||||
|
|
||||||
(defun jupyter-make-ssh-tunnel (lport rport server remoteip)
|
(defun jupyter-make-ssh-tunnel (local-port remote-ip remote-port remote-host)
|
||||||
(or remoteip (setq remoteip "127.0.0.1"))
|
"Tunnel LOCAL-PORT to REMOTE-IP:REMOTE-PORT on REMOTE-HOST, an SSH host.
|
||||||
|
This uses ssh for the tunneling."
|
||||||
|
(or remote-ip (setq remote-ip "127.0.0.1"))
|
||||||
(start-process
|
(start-process
|
||||||
"jupyter-ssh-tunnel" nil
|
"jupyter-ssh-tunnel" nil
|
||||||
"ssh"
|
"ssh"
|
||||||
|
@ -496,8 +498,8 @@ following fields:
|
||||||
;; Wait until the tunnel is open
|
;; Wait until the tunnel is open
|
||||||
"-o ExitOnForwardFailure=yes"
|
"-o ExitOnForwardFailure=yes"
|
||||||
;; Local forward
|
;; Local forward
|
||||||
"-L" (format "127.0.0.1:%d:%s:%d" lport remoteip rport)
|
"-L" (format "127.0.0.1:%d:%s:%d" local-port remote-ip remote-port)
|
||||||
server
|
remote-host
|
||||||
;; Close the tunnel if no other connections are made within 60
|
;; Close the tunnel if no other connections are made within 60
|
||||||
;; seconds
|
;; seconds
|
||||||
"sleep 60"))
|
"sleep 60"))
|
||||||
|
@ -557,7 +559,7 @@ replaced and set to \"127.0.0.1\"."
|
||||||
(local-port (pop local-ports)))
|
(local-port (pop local-ports)))
|
||||||
(prog1 local-port
|
(prog1 local-port
|
||||||
(jupyter-make-ssh-tunnel
|
(jupyter-make-ssh-tunnel
|
||||||
local-port remote-port remote-host remote-ip)))
|
local-port remote-ip remote-port remote-host)))
|
||||||
else collect value))))
|
else collect value))))
|
||||||
|
|
||||||
;;; Helper functions
|
;;; Helper functions
|
||||||
|
|
Loading…
Add table
Reference in a new issue