This function creates a websocket connection to a remote instance using the Chrome Debugging Protocol.

CDPSession(
  host = "localhost",
  port = 9222,
  secure = FALSE,
  ws_url = NULL,
  local = FALSE,
  callback = NULL
)

Arguments

host

Character scalar, the host name of the application.

port

The remote debugging port (a numeric or a character scalar).

secure

A logical indicating whether a secure protocol shall be used.

ws_url

Character scalar, the websocket URL. If provided, host and port arguments are ignored.

local

Logical scalar, indicating whether the local version of the protocol (embedded in crrri) must be used or the protocol must be fetched remotely.

callback

Function with one argument, executed when the R session is connected to Chrome. The connection object is passed to this function.

Value

The returned value depends on the value of the callback argument. When callback is a function, the returned value is a connection object of class CDPSession. When callback is NULL the returned value is a promise which becomes fulfilled once R is connected to the remote instance. Once fulfilled, the value of this promise is the connection object of class CDPSession.