diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml
index 6058f07a..37d6dd0e 100644
--- a/.github/workflows/R-CMD-check.yaml
+++ b/.github/workflows/R-CMD-check.yaml
@@ -22,3 +22,84 @@ jobs:
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1
with:
ubuntu: "ubuntu-22.04 ubuntu-latest"
+
+ system-libuv:
+ # Ubuntu 22.04 has libuv1-dev version 1.43, which is sufficient
+ runs-on: ubuntu-latest
+ name: Installed=${{ matrix.config.install }} Bundled=${{ matrix.config.use }}
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ # This one should test that we've used system and everything runs ok
+ - {install: true}
+ # This one should test for bundling log message
+ - {install: true, use: true}
+ # This one should test for failure
+ - {install: false, use: false}
+
+ env:
+ GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
+ R_KEEP_PKG_SOURCE: yes
+
+ steps:
+ - uses: actions/checkout@v7
+
+ - uses: r-lib/actions/setup-r@v2
+ with:
+ use-public-rspm: true
+
+ - uses: r-lib/actions/setup-r-dependencies@v2
+ with:
+ extra-packages: any::rcmdcheck
+ needs: check
+
+ - name: Install libuv
+ if: ${{ matrix.config.install }}
+ # If we add tests for e.g. rhel/centos, we couldn't assume apt-get
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y libuv1-dev
+
+ - name: Ensure libuv is not on the system
+ if: ${{ !matrix.config.install }}
+ run: |
+ sudo apt-get remove -y libuv1-dev || true
+
+ - uses: r-lib/actions/check-r-package@v2
+ if: ${{ matrix.config.install }}
+ env:
+ USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
+ with:
+ upload-snapshots: true
+
+ - name: Confirm that USE_BUNDLED_LIBUV was respected
+ if: ${{ matrix.config.install }}
+ env:
+ USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
+ run: |
+ if [ "$USE_BUNDLED_LIBUV" = "true" ]; then
+ grep "Using bundled copy of libuv" check/httpuv.Rcheck/00install.out
+ else
+ grep "Using libuv found by pkg-config" check/httpuv.Rcheck/00install.out
+ fi
+
+ - name: Confirm error if system libuv missing and use=false
+ if: ${{ !matrix.config.install && !matrix.config.use }}
+ env:
+ USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
+ run: |
+ R CMD INSTALL . > install.log || true
+ grep "Did not find suitable libuv on your system" install.log
+
+ # Single stable context to mark as a required status check on `main`.
+ # Matrix job names are not stable enough to require individually.
+ done:
+ if: always()
+ needs: [website, routine, R-CMD-check, system-libuv]
+ runs-on: ubuntu-latest
+ steps:
+ # ponytail: `skipped` counts as success; add it here if any job above
+ # ever gains a path filter or `if:` condition.
+ - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
+ run: exit 1
diff --git a/.github/workflows/system-libuv.yaml b/.github/workflows/system-libuv.yaml
deleted file mode 100644
index 6fe5f1e6..00000000
--- a/.github/workflows/system-libuv.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
-# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
-on:
- push:
- branches: [main, rc-**]
- pull_request:
- schedule:
- - cron: '0 6 * * 1' # every monday
-
-name: Test system libuv
-
-jobs:
- R-CMD-check:
- # Ubuntu 22.04 has libuv1-dev version 1.43, which is sufficient
- runs-on: ubuntu-latest
- name: Installed=${{ matrix.config.install }} Bundled=${{ matrix.config.use }}
- strategy:
- fail-fast: false
- matrix:
- config:
- # This one should test that we've used system and everything runs ok
- - {install: true}
- # This one should test for bundling log message
- - {install: true, use: true}
- # This one should test for failure
- - {install: false, use: false}
-
- env:
- GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- R_KEEP_PKG_SOURCE: yes
-
- steps:
- - uses: actions/checkout@v3
-
- - uses: r-lib/actions/setup-r@v2
- with:
- use-public-rspm: true
-
- - uses: r-lib/actions/setup-r-dependencies@v2
- with:
- extra-packages: any::rcmdcheck
- needs: check
-
- - name: Install libuv
- if: ${{ matrix.config.install }}
- # If we add tests for e.g. rhel/centos, we couldn't assume apt-get
- run: |
- sudo apt-get update -y
- sudo apt-get install -y libuv1-dev
-
- - name: Ensure libuv is not on the system
- if: ${{ !matrix.config.install }}
- run: |
- sudo apt-get remove -y libuv1-dev || true
-
- - uses: r-lib/actions/check-r-package@v2
- if: ${{ matrix.config.install }}
- env:
- USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
- with:
- upload-snapshots: true
-
- - name: Confirm that USE_BUNDLED_LIBUV was respected
- if: ${{ matrix.config.install }}
- env:
- USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
- run: |
- if [ "$USE_BUNDLED_LIBUV" = "true" ]; then
- grep "Using bundled copy of libuv" check/httpuv.Rcheck/00install.out
- else
- grep "Using libuv found by pkg-config" check/httpuv.Rcheck/00install.out
- fi
-
- - name: Confirm error if system libuv missing and use=false
- if: ${{ !matrix.config.install && !matrix.config.use }}
- env:
- USE_BUNDLED_LIBUV: ${{ matrix.config.use }}
- run: |
- R CMD INSTALL . > install.log || true
- grep "Did not find suitable libuv on your system" install.log
\ No newline at end of file
diff --git a/DESCRIPTION b/DESCRIPTION
index 4868f6ca..4ee8f7ba 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -72,11 +72,11 @@ LinkingTo:
later,
Rcpp
Config/Needs/website: tidyverse/tidytemplate
+Config/roxygen2/version: 8.1.0
Config/testthat/edition: 3
Config/usethis/last-upkeep: 2025-07-01
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
-RoxygenNote: 7.3.3
SystemRequirements: GNU make, zlib
Collate:
'RcppExports.R'
diff --git a/NAMESPACE b/NAMESPACE
index 5200da44..0d21c97a 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -34,10 +34,12 @@ export(stopServer)
importFrom(R6,R6Class)
importFrom(Rcpp,evalCpp)
importFrom(later,run_now)
-importFrom(promises,"%...!%")
-importFrom(promises,"%...>%")
-importFrom(promises,finally)
-importFrom(promises,is.promise)
-importFrom(promises,promise)
-importFrom(promises,then)
+importFrom(promises,
+ "%...!%",
+ "%...>%",
+ finally,
+ is.promise,
+ promise,
+ then
+)
useDynLib(httpuv, .registration = TRUE)
diff --git a/demo/daemon-echo.R b/demo/daemon-echo.R
index b2102d4d..da7d7119 100644
--- a/demo/daemon-echo.R
+++ b/demo/daemon-echo.R
@@ -4,7 +4,7 @@ library(httpuv)
app <- list(
call = function(req) {
- wsUrl = paste(
+ wsUrl <- paste(
sep = '',
'"',
"ws://",
diff --git a/demo/echo.R b/demo/echo.R
index 4c0de362..470b0392 100644
--- a/demo/echo.R
+++ b/demo/echo.R
@@ -2,7 +2,7 @@ library(httpuv)
app <- list(
call = function(req) {
- wsUrl = paste(
+ wsUrl <- paste(
sep = '',
'"',
"ws://",
diff --git a/man/PipeServer.Rd b/man/PipeServer.Rd
index 865b487c..7502667c 100644
--- a/man/PipeServer.Rd
+++ b/man/PipeServer.Rd
@@ -10,7 +10,7 @@ named pipe.
\examples{
## ------------------------------------------------
-## Method `PipeServer$new`
+## Method `PipeServer$new()`
## ------------------------------------------------
\dontrun{
@@ -31,62 +31,57 @@ server <- PipeServer$new("my_pipe", -1, app)
}
\keyword{internal}
\section{Super class}{
-\code{\link[httpuv:Server]{httpuv::Server}} -> \code{PipeServer}
+\code{\link[httpuv:Server]{Server}} -> \code{PipeServer}
}
\section{Methods}{
\subsection{Public methods}{
-\itemize{
-\item \href{#method-PipeServer-new}{\code{PipeServer$new()}}
-\item \href{#method-PipeServer-getName}{\code{PipeServer$getName()}}
-\item \href{#method-PipeServer-getMask}{\code{PipeServer$getMask()}}
+ \itemize{
+ \item \href{#method-PipeServer-initialize}{\code{PipeServer$new()}}
+ \item \href{#method-PipeServer-getName}{\code{PipeServer$getName()}}
+ \item \href{#method-PipeServer-getMask}{\code{PipeServer$getMask()}}
+ }
}
-}
-\if{html}{\out{
-Inherited methods
+\if{html}{\out{Inherited methods
-
-}}
+ }}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-PipeServer-new}{}}}
-\subsection{Method \code{new()}}{
-Initialize a new PipeServer object
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-PipeServer-initialize}{}}}
+\subsection{\code{PipeServer$new()}}{
+ Initialize a new PipeServer object
Create a new \code{PipeServer} object. \code{app} is an httpuv application
object as described in \code{\link[=startServer]{startServer()}}.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{PipeServer$new(name, mask, app, quiet = FALSE)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{name}}{The name of the named pipe to bind the server to.}
-
-\item{\code{mask}}{The mask for the named pipe. If NULL, it defaults to -1.}
-
-\item{\code{app}}{An httpuv application object as described in
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{PipeServer$new(name, mask, app, quiet = FALSE)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{name}}{The name of the named pipe to bind the server to.}
+ \item{\code{mask}}{The mask for the named pipe. If NULL, it defaults to -1.}
+ \item{\code{app}}{An httpuv application object as described in
\code{\link[=startServer]{startServer()}}.}
-
-\item{\code{quiet}}{If TRUE, suppresses output from the server.}
-}
-\if{html}{\out{
}}
-}
-\subsection{Returns}{
-A new \code{PipeServer} object.
-}
-\subsection{Examples}{
-\if{html}{\out{
}}
-\preformatted{\dontrun{
-# Create a simple app
+ \item{\code{quiet}}{If TRUE, suppresses output from the server.}
+ }
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ A new \code{PipeServer} object.
+ }
+ \subsection{Examples}{
+ \if{html}{\out{
}}
+ \preformatted{# Create a simple app
app <- function(req) {
list(
status = 200L,
@@ -97,36 +92,38 @@ app <- function(req) {
# Create a server
server <- PipeServer$new("my_pipe", -1, app)
}
-}
-\if{html}{\out{
}}
-
+ \if{html}{\out{
}}
+ }
}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-PipeServer-getName}{}}}
-\subsection{Method \code{getName()}}{
-Get the name of the named pipe
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{PipeServer$getName()}\if{html}{\out{
}}
+\subsection{\code{PipeServer$getName()}}{
+ Get the name of the named pipe
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{PipeServer$getName()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ The name of the named pipe that the server is bound to.
+ }
}
-\subsection{Returns}{
-The name of the named pipe that the server is bound to.
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-PipeServer-getMask}{}}}
-\subsection{Method \code{getMask()}}{
-Get the mask for the named pipe
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{PipeServer$getMask()}\if{html}{\out{
}}
+\subsection{\code{PipeServer$getMask()}}{
+ Get the mask for the named pipe
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{PipeServer$getMask()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ The mask for the named pipe that the server is bound to.
+ }
}
-\subsection{Returns}{
-The mask for the named pipe that the server is bound to.
-}
-}
}
diff --git a/man/Server.Rd b/man/Server.Rd
index 77c94ae6..74bb83b2 100644
--- a/man/Server.Rd
+++ b/man/Server.Rd
@@ -11,7 +11,7 @@ be instantiated.
\examples{
## ------------------------------------------------
-## Method `Server$setStaticPath`
+## Method `Server$setStaticPath()`
## ------------------------------------------------
\dontrun{
@@ -25,7 +25,7 @@ server$setStaticPath(
}
## ------------------------------------------------
-## Method `Server$removeStaticPath`
+## Method `Server$removeStaticPath()`
## ------------------------------------------------
\dontrun{
@@ -46,78 +46,83 @@ server$removeStaticPath("staticPath1")
\keyword{internal}
\section{Methods}{
\subsection{Public methods}{
-\itemize{
-\item \href{#method-Server-stop}{\code{Server$stop()}}
-\item \href{#method-Server-isRunning}{\code{Server$isRunning()}}
-\item \href{#method-Server-getStaticPaths}{\code{Server$getStaticPaths()}}
-\item \href{#method-Server-setStaticPath}{\code{Server$setStaticPath()}}
-\item \href{#method-Server-removeStaticPath}{\code{Server$removeStaticPath()}}
-\item \href{#method-Server-getStaticPathOptions}{\code{Server$getStaticPathOptions()}}
-\item \href{#method-Server-setStaticPathOption}{\code{Server$setStaticPathOption()}}
-}
+ \itemize{
+ \item \href{#method-Server-stop}{\code{Server$stop()}}
+ \item \href{#method-Server-isRunning}{\code{Server$isRunning()}}
+ \item \href{#method-Server-getStaticPaths}{\code{Server$getStaticPaths()}}
+ \item \href{#method-Server-setStaticPath}{\code{Server$setStaticPath()}}
+ \item \href{#method-Server-removeStaticPath}{\code{Server$removeStaticPath()}}
+ \item \href{#method-Server-getStaticPathOptions}{\code{Server$getStaticPathOptions()}}
+ \item \href{#method-Server-setStaticPathOption}{\code{Server$setStaticPathOption()}}
+ }
}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-stop}{}}}
-\subsection{Method \code{stop()}}{
-Stop a running server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$stop()}\if{html}{\out{
}}
+\subsection{\code{Server$stop()}}{
+ Stop a running server
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{Server$stop()}
+ \if{html}{\out{
}}
+ }
}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-isRunning}{}}}
-\subsection{Method \code{isRunning()}}{
-Check if the server is running
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$isRunning()}\if{html}{\out{
}}
+\subsection{\code{Server$isRunning()}}{
+ Check if the server is running
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{Server$isRunning()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ TRUE if the server is running, FALSE otherwise.
+ }
}
-\subsection{Returns}{
-TRUE if the server is running, FALSE otherwise.
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-getStaticPaths}{}}}
-\subsection{Method \code{getStaticPaths()}}{
-Get the static paths for the server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$getStaticPaths()}\if{html}{\out{
}}
+\subsection{\code{Server$getStaticPaths()}}{
+ Get the static paths for the server
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{Server$getStaticPaths()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ A list of \code{\link[=staticPath]{staticPath()}} objects.
+ }
}
-\subsection{Returns}{
-A list of \code{\link[=staticPath]{staticPath()}} objects.
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-setStaticPath}{}}}
-\subsection{Method \code{setStaticPath()}}{
-Set a static path for the server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$setStaticPath(..., .list = NULL)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{...}}{Named arguments where each name is the name of the static path
+\subsection{\code{Server$setStaticPath()}}{
+ Set a static path for the server
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{Server$setStaticPath(..., .list = NULL)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{...}}{Named arguments where each name is the name of the static path
and the value is the path to the directory to serve. If there already
exists a static path with the same name, it will be replaced.}
-
-\item{\code{.list}}{A named list where each name is the name of the static path
+ \item{\code{.list}}{A named list where each name is the name of the static path
and the value is the path to the directory to serve. If there already
exists a static path with the same name, it will be replaced.}
-}
-\if{html}{\out{
}}
-}
-\subsection{Examples}{
-\if{html}{\out{
}}
-\preformatted{\dontrun{
-# Create a server
+ }
+ \if{html}{\out{
}}
+ }
+ \subsection{Examples}{
+ \if{html}{\out{
}}
+ \preformatted{# Create a server
server <- WebServer$new("127.0.0.1", 8080, app = my_app)
#' # Set a static path
server$setStaticPath(
@@ -125,36 +130,34 @@ server$setStaticPath(
staticPath2 = "another/path/to/static/files"
)
}
-}
-\if{html}{\out{
}}
-
+ \if{html}{\out{
}}
+ }
}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-removeStaticPath}{}}}
-\subsection{Method \code{removeStaticPath()}}{
-Remove a static path
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$removeStaticPath(path)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{path}}{The name of the static path to remove.}
-}
-\if{html}{\out{
}}
-}
-\subsection{Returns}{
-An invisible NULL if the server is running, otherwise it does
+\subsection{\code{Server$removeStaticPath()}}{
+ Remove a static path
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{Server$removeStaticPath(path)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{}}
+ \describe{
+ \item{\code{path}}{The name of the static path to remove.}
+ }
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ An invisible NULL if the server is running, otherwise it does
nothing.
-}
-\subsection{Examples}{
-\if{html}{\out{}}
-\preformatted{\dontrun{
-# Create a server
+ }
+ \subsection{Examples}{
+ \if{html}{\out{
}}
+ \preformatted{# Create a server
server <- WebServer$new("127.0.0.1", 8080, app = my_app)
# Set a static path
server$setStaticPath(
@@ -164,50 +167,51 @@ server$setStaticPath(
# Remove a static path
server$removeStaticPath("staticPath1")
}
-}
-\if{html}{\out{
}}
-
+ \if{html}{\out{
}}
+ }
}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-getStaticPathOptions}{}}}
-\subsection{Method \code{getStaticPathOptions()}}{
-Get the static path options for the server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$getStaticPathOptions()}\if{html}{\out{
}}
-}
-
-\subsection{Returns}{
-A list of default \code{staticPathOptions} for the current server.
+\subsection{\code{Server$getStaticPathOptions()}}{
+ Get the static path options for the server
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{Server$getStaticPathOptions()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ A list of default \code{staticPathOptions} for the current server.
Each static path will use these options by default, but they can be
overridden for each static path.
+ }
}
-}
+
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-Server-setStaticPathOption}{}}}
-\subsection{Method \code{setStaticPathOption()}}{
-Set one or more static path options
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{Server$setStaticPathOption(..., .list = NULL)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{...}}{Named arguments where each name is the name of the static path
+\subsection{\code{Server$setStaticPathOption()}}{
+ Set one or more static path options
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{Server$setStaticPathOption(..., .list = NULL)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{...}}{Named arguments where each name is the name of the static path
option and the value is the value to set for that option.}
-
-\item{\code{.list}}{A named list where each name is the name of the static path
+ \item{\code{.list}}{A named list where each name is the name of the static path
option and the value is the value to set for that option.}
-}
-\if{html}{\out{
}}
-}
-\subsection{Returns}{
-An invisible NULL if the server is running, otherwise it does
+ }
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ An invisible NULL if the server is running, otherwise it does
nothing.
+ }
}
-}
+
}
diff --git a/man/WebServer.Rd b/man/WebServer.Rd
index 2e5d9926..daf83c78 100644
--- a/man/WebServer.Rd
+++ b/man/WebServer.Rd
@@ -10,7 +10,7 @@ can be running at the same time.
\examples{
## ------------------------------------------------
-## Method `WebServer$new`
+## Method `WebServer$new()`
## ------------------------------------------------
\dontrun{
@@ -31,61 +31,56 @@ server <- WebServer$new("127.0.0.1", 8080, app)
}
\keyword{internal}
\section{Super class}{
-\code{\link[httpuv:Server]{httpuv::Server}} -> \code{WebServer}
+\code{\link[httpuv:Server]{Server}} -> \code{WebServer}
}
\section{Methods}{
\subsection{Public methods}{
-\itemize{
-\item \href{#method-WebServer-new}{\code{WebServer$new()}}
-\item \href{#method-WebServer-getHost}{\code{WebServer$getHost()}}
-\item \href{#method-WebServer-getPort}{\code{WebServer$getPort()}}
+ \itemize{
+ \item \href{#method-WebServer-initialize}{\code{WebServer$new()}}
+ \item \href{#method-WebServer-getHost}{\code{WebServer$getHost()}}
+ \item \href{#method-WebServer-getPort}{\code{WebServer$getPort()}}
+ }
}
-}
-\if{html}{\out{
-Inherited methods
+\if{html}{\out{Inherited methods
-
-}}
+ }}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-WebServer-new}{}}}
-\subsection{Method \code{new()}}{
-Initialize a new WebServer object
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-WebServer-initialize}{}}}
+\subsection{\code{WebServer$new()}}{
+ Initialize a new WebServer object
Create a new \code{WebServer} object. \code{app} is an httpuv application
object as described in \code{\link[=startServer]{startServer()}}.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebServer$new(host, port, app, quiet = FALSE)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{host}}{The host name or IP address to bind the server to.}
-
-\item{\code{port}}{The port number to bind the server to.}
-
-\item{\code{app}}{An httpuv application object as described in \code{\link[=startServer]{startServer()}}.}
-
-\item{\code{quiet}}{If TRUE, suppresses output from the server.}
-}
-\if{html}{\out{
}}
-}
-\subsection{Returns}{
-A new \code{WebServer} object.
-}
-\subsection{Examples}{
-\if{html}{\out{}}
-\preformatted{\dontrun{
-# Create a simple app
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{WebServer$new(host, port, app, quiet = FALSE)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{host}}{The host name or IP address to bind the server to.}
+ \item{\code{port}}{The port number to bind the server to.}
+ \item{\code{app}}{An httpuv application object as described in \code{\link[=startServer]{startServer()}}.}
+ \item{\code{quiet}}{If TRUE, suppresses output from the server.}
+ }
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ A new \code{WebServer} object.
+ }
+ \subsection{Examples}{
+ \if{html}{\out{
}}
+ \preformatted{# Create a simple app
app <- function(req) {
list(
status = 200L,
@@ -96,36 +91,38 @@ app <- function(req) {
# Create a server
server <- WebServer$new("127.0.0.1", 8080, app)
}
-}
-\if{html}{\out{
}}
-
+ \if{html}{\out{
}}
+ }
}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebServer-getHost}{}}}
-\subsection{Method \code{getHost()}}{
-Get the host name or IP address of the server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebServer$getHost()}\if{html}{\out{
}}
+\subsection{\code{WebServer$getHost()}}{
+ Get the host name or IP address of the server
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebServer$getHost()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ The host name or IP address that the server is bound to.
+ }
}
-\subsection{Returns}{
-The host name or IP address that the server is bound to.
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebServer-getPort}{}}}
-\subsection{Method \code{getPort()}}{
-Get the port number of the server
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebServer$getPort()}\if{html}{\out{
}}
+\subsection{\code{WebServer$getPort()}}{
+ Get the port number of the server
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebServer$getPort()}
+ \if{html}{\out{
}}
+ }
+ \subsection{Returns}{
+ The port number that the server is bound to.
+ }
}
-\subsection{Returns}{
-The port number that the server is bound to.
-}
-}
}
diff --git a/man/WebSocket.Rd b/man/WebSocket.Rd
index cc24d6a7..5e56384e 100644
--- a/man/WebSocket.Rd
+++ b/man/WebSocket.Rd
@@ -45,142 +45,152 @@ startServer("0.0.0.0", 8080,
}
}
\section{Public fields}{
-\if{html}{\out{}}
-\describe{
-\item{\code{handle}}{The server handle}
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{handle}}{The server handle}
-\item{\code{messageCallbacks}}{A list of callback functions that will be invoked
+ \item{\code{messageCallbacks}}{A list of callback functions that will be invoked
when a message is received on this connection.}
-\item{\code{closeCallbacks}}{A list of callback functions that will be invoked
+ \item{\code{closeCallbacks}}{A list of callback functions that will be invoked
when the connection is closed.}
-\item{\code{request}}{The Rook request environment that opened the connection.
+ \item{\code{request}}{The Rook request environment that opened the connection.
This can be used to inspect HTTP headers, for example.}
-}
-\if{html}{\out{
}}
+ }
+ \if{html}{\out{
}}
}
\section{Methods}{
\subsection{Public methods}{
-\itemize{
-\item \href{#method-WebSocket-new}{\code{WebSocket$new()}}
-\item \href{#method-WebSocket-onMessage}{\code{WebSocket$onMessage()}}
-\item \href{#method-WebSocket-onClose}{\code{WebSocket$onClose()}}
-\item \href{#method-WebSocket-send}{\code{WebSocket$send()}}
-\item \href{#method-WebSocket-close}{\code{WebSocket$close()}}
-\item \href{#method-WebSocket-clone}{\code{WebSocket$clone()}}
-}
+ \itemize{
+ \item \href{#method-WebSocket-initialize}{\code{WebSocket$new()}}
+ \item \href{#method-WebSocket-onMessage}{\code{WebSocket$onMessage()}}
+ \item \href{#method-WebSocket-onClose}{\code{WebSocket$onClose()}}
+ \item \href{#method-WebSocket-send}{\code{WebSocket$send()}}
+ \item \href{#method-WebSocket-close}{\code{WebSocket$close()}}
+ \item \href{#method-WebSocket-clone}{\code{WebSocket$clone()}}
+ }
}
\if{html}{\out{
}}
-\if{html}{\out{}}
-\if{latex}{\out{\hypertarget{method-WebSocket-new}{}}}
-\subsection{Method \code{new()}}{
-Initializes a new WebSocket object.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$new(handle, req)}\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-WebSocket-initialize}{}}}
+\subsection{\code{WebSocket$new()}}{
+ Initializes a new WebSocket object.
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebSocket$new(handle, req)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{}}
+ \describe{
+ \item{\code{handle}}{An C++ WebSocket handle.}
+ \item{\code{req}}{The Rook request environment that opened the connection.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{handle}}{An C++ WebSocket handle.}
-
-\item{\code{req}}{The Rook request environment that opened the connection.}
-}
-\if{html}{\out{
}}
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebSocket-onMessage}{}}}
-\subsection{Method \code{onMessage()}}{
-Registers a callback function that will be invoked whenever a message is
+\subsection{\code{WebSocket$onMessage()}}{
+ Registers a callback function that will be invoked whenever a message is
received on this connection.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$onMessage(func)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{func}}{The callback function to be registered. The callback function will be invoked with
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{WebSocket$onMessage(func)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{func}}{The callback function to be registered. The callback function will be invoked with
two arguments. The first argument is \code{TRUE} if the message is binary
and \code{FALSE} if it is text. The second argument is either a raw
vector (if the message is binary) or a character vector.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\if{html}{\out{
}}
-}
-}
+
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebSocket-onClose}{}}}
-\subsection{Method \code{onClose()}}{
-Registers a callback function that will be invoked when the connection is
+\subsection{\code{WebSocket$onClose()}}{
+ Registers a callback function that will be invoked when the connection is
closed.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$onClose(func)}\if{html}{\out{
}}
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebSocket$onClose(func)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{}}
+ \describe{
+ \item{\code{func}}{The callback function to be registered.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{func}}{The callback function to be registered.}
-}
-\if{html}{\out{
}}
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebSocket-send}{}}}
-\subsection{Method \code{send()}}{
-Begins sending the given message over the websocket.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$send(message)}\if{html}{\out{
}}
-}
-
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{message}}{Either a raw vector, or a single-element character
+\subsection{\code{WebSocket$send()}}{
+ Begins sending the given message over the websocket.
+ \subsection{Usage}{
+ \if{html}{\out{
}}
+ \preformatted{WebSocket$send(message)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{
}}
+ \describe{
+ \item{\code{message}}{Either a raw vector, or a single-element character
vector that is encoded in UTF-8.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\if{html}{\out{
}}
-}
-}
+
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebSocket-close}{}}}
-\subsection{Method \code{close()}}{
-Closes the websocket connection
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$close(code = 1000L, reason = "")}\if{html}{\out{
}}
+\subsection{\code{WebSocket$close()}}{
+ Closes the websocket connection
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebSocket$close(code = 1000L, reason = "")}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{}}
+ \describe{
+ \item{\code{code}}{An integer that indicates the \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code}{WebSocket close code}.}
+ \item{\code{reason}}{A concise human-readable prose \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason}{explanation for the closure}.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{code}}{An integer that indicates the \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code}{WebSocket close code}.}
-
-\item{\code{reason}}{A concise human-readable prose \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason}{explanation for the closure}.}
-}
-\if{html}{\out{
}}
-}
-}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-WebSocket-clone}{}}}
-\subsection{Method \code{clone()}}{
-The objects of this class are cloneable with this method.
-\subsection{Usage}{
-\if{html}{\out{}}\preformatted{WebSocket$clone(deep = FALSE)}\if{html}{\out{
}}
+\subsection{\code{WebSocket$clone()}}{
+ The objects of this class are cloneable with this method.
+ \subsection{Usage}{
+ \if{html}{\out{}}
+ \preformatted{WebSocket$clone(deep = FALSE)}
+ \if{html}{\out{
}}
+ }
+ \subsection{Arguments}{
+ \if{html}{\out{}}
+ \describe{
+ \item{\code{deep}}{Whether to make a deep clone.}
+ }
+ \if{html}{\out{
}}
+ }
}
-\subsection{Arguments}{
-\if{html}{\out{}}
-\describe{
-\item{\code{deep}}{Whether to make a deep clone.}
-}
-\if{html}{\out{
}}
-}
-}
}
diff --git a/man/encodeURI.Rd b/man/encodeURI.Rd
index 6671c0e9..bc77c52e 100644
--- a/man/encodeURI.Rd
+++ b/man/encodeURI.Rd
@@ -34,7 +34,7 @@ developer.mozilla.org:
}
\details{
Intended as a faster replacement for \code{\link[utils:URLencode]{utils::URLencode()}} and
-\code{\link[utils:URLencode]{utils::URLdecode()}}.
+\code{\link[utils:URLdecode]{utils::URLdecode()}}.
encodeURI differs from encodeURIComponent in that the former will not encode
reserved characters: \code{;,/?:@&=+$}
diff --git a/man/runStaticServer.Rd b/man/runStaticServer.Rd
index 3da02c59..31e4ec67 100644
--- a/man/runStaticServer.Rd
+++ b/man/runStaticServer.Rd
@@ -24,7 +24,7 @@ listened on. Note that on most Unix-like systems including Linux and macOS,
port numbers smaller than 1024 require root privileges.}
\item{...}{
- Arguments passed on to \code{\link[=staticPath]{staticPath}}
+ Arguments passed on to \code{\link{staticPath}}
\describe{
\item{\code{path}}{The local path.}
\item{\code{indexhtml}}{If an index.html file is present, should it be served up