Binds and listens for connections at the specified host and port.
listen( beakr = NULL, host = "127.0.0.1", port = 25118, daemon = FALSE, verbose = FALSE )
beakr |
|
---|---|
host | String that is a valid IPv4 or IPv6 address to listen on. Defaults to the local host ("127.0.0.1"). |
port | Number or integer that indicates the port to listen on. Default is a port opened on 25118. |
daemon | Logical specifying whether the server should be run in the background. |
verbose | Logical specifying whether to print out details of the
|
A Beakr
instance with an active server.
listen()
binds the specified host and port and listens for connections
on a thread. The thread handles incoming requests. when it receives an HTTP
request, it will schedule a call to the user-defined middleware and handle the
request.
If daemon = TRUE
, listen()
binds the specified port and listens
for connections on a thread running in the background.
See the httpuv package for more details.
The default port number 25118 was generated using:
> match(c("b","e","a","k","r"), letters) %% 10 [1] 2 5 1 1 8