@@ -107,20 +107,24 @@ end
107107# -------------------------------------------------------------------------------
108108# Client side connection / session handling
109109mutable struct Connection
110- host
111- port
112- tunnel
113- ssh_opts
114- region
115- namespace
116- socket
117- in_module
110+ host:: Union{AbstractString,Sockets.IPAddr}
111+ port:: Int
112+ tunnel:: Symbol
113+ ssh_opts:: Cmd
114+ region:: Union{AbstractString,Nothing}
115+ namespace:: Union{AbstractString,Nothing}
116+ socket:: Union{IO,Nothing}
117+ in_module:: Symbol
118118end
119119
120- function Connection (; host= Sockets. localhost, port:: Integer = DEFAULT_PORT,
121- tunnel:: Symbol = host!= Sockets. localhost ? :ssh : :none ,
122- ssh_opts= ` ` , region= nothing , namespace= nothing )
123- conn = Connection (host, port, tunnel, ssh_opts, region, namespace, nothing , :Main )
120+ function Connection (; host:: Union{AbstractString,Sockets.IPAddr} = Sockets. localhost,
121+ port:: Integer = DEFAULT_PORT,
122+ tunnel:: Symbol = host!= Sockets. localhost ? :ssh : :none ,
123+ ssh_opts:: Cmd = ` ` ,
124+ region= nothing ,
125+ namespace= nothing ,
126+ in_module:: Symbol = :Main )
127+ conn = Connection (host, port, tunnel, ssh_opts, region, namespace, nothing , in_module)
124128 setup_connection! (conn)
125129 finalizer (close, conn)
126130end
@@ -417,10 +421,10 @@ that `host` needs to be running an ssh server and you need ssh credentials set
417421up for use on that host. For secure networks this can be disabled by setting
418422`tunnel=:none`.
419423
420- To provide extra options to SSH, you may use the `ssh_opts` keyword, for
421- example an identity file may be set with ```ssh_opts = `-i /path/to/identity.pem` ```.
422- Alternatively, you may want to set this up permanently using a `Host` section
423- in your ssh config file.
424+ To provide extra options to SSH, you may pass a `Cmd` object in the `ssh_opts`
425+ keyword, for example an identity file may be set with ```ssh_opts = `-i
426+ /path/to/identity.pem` ```. For a more permanent solution, add a `Host` section
427+ to your ssh config file.
424428
425429You can also use the following technologies for tunneling in place of SSH:
4264301) AWS Session Manager: set `tunnel=:aws`. The optional `region` keyword
@@ -432,8 +436,11 @@ See README.md for more information.
432436"""
433437function connect_repl (host= Sockets. localhost, port:: Integer = DEFAULT_PORT;
434438 tunnel:: Symbol = host!= Sockets. localhost ? :ssh : :none ,
435- ssh_opts= ` ` , region= nothing , namespace= nothing ,
436- startup_text= true , repl= Base. active_repl)
439+ ssh_opts:: Cmd = ` ` ,
440+ region:: Union{AbstractString,Nothing} = nothing ,
441+ namespace:: Union{AbstractString,Nothing} = nothing ,
442+ startup_text:: Bool = true ,
443+ repl= Base. active_repl)
437444 global _repl_client_connection
438445
439446 if ! isnothing (_repl_client_connection)
0 commit comments