host_url: Host URL Constructor

View source: R/daemons.R

host_urlR Documentation

Host URL Constructor

Description

Automatically 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.

Usage

host_url(ws = FALSE, tls = FALSE, port = 0)

Arguments

ws

[default FALSE] logical value whether to use a WebSockets 'ws://' or else TCP 'tcp://' scheme.

tls

[default FALSE] logical value whether to use TLS in which case the scheme used will be either 'wss://' or 'tls+tcp://' accordingly.

port

[default 0] numeric port to use. This should be open to connections from the network addresses the daemons are connecting from. '0' is a wildcard value that automatically assigns a free ephemeral port.

Details

This implementation 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.

Value

A character string comprising a valid host URL.

Examples

host_url()
host_url(ws = TRUE)
host_url(tls = TRUE)
host_url(ws = TRUE, tls = TRUE, port = 5555)


mirai documentation built on Nov. 16, 2023, 5:08 p.m.