host_url
constructs a valid host URL (at which daemons may connect)
based on the computer's hostname. This may be supplied directly to the url
argument of daemons()
.
local_url
constructs a URL suitable for local daemons, or for use with
SSH tunnelling. This may be supplied directly to the url
argument of
daemons()
.
Arguments
- tls
[default FALSE] logical value whether to use TLS in which case the scheme used will be 'tls+tcp://'.
- port
[default 0] numeric port to use.
0
is a wildcard value that automatically assigns a free ephemeral port. Forhost_url
, this port should be open to connections from the network addresses the daemons are connecting from. Forlocal_url
, is only taken into account iftcp = TRUE
.- tcp
[default FALSE] logical value whether to use a TCP connection. This must be used for SSH tunnelling.
Details
host_url
relies on using the host name of the computer rather than an IP
address and typically works on local networks, although this is not always
guaranteed. If unsuccessful, substitute an IPv4 or IPv6 address in place of
the hostname.
local_url
generates a random URL for the platform's default inter-process
communications transport: abstract Unix domain sockets on Linux, Unix domain
sockets on MacOS, Solaris and other POSIX platforms, and named pipes on
Windows.
Examples
host_url()
#> [1] "tcp://fv-az1695-672:0"
host_url(tls = TRUE)
#> [1] "tls+tcp://fv-az1695-672:0"
host_url(tls = TRUE, port = 5555)
#> [1] "tls+tcp://fv-az1695-672:5555"
local_url()
#> [1] "abstract://82d2195be4a79cf258e9eedd"
local_url(tcp = TRUE)
#> [1] "tcp://127.0.0.1:0"
local_url(tcp = TRUE, port = 5555)
#> [1] "tcp://127.0.0.1:5555"