1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# httpuv: HTTP and WebSocket server library for R
[](https://travis-ci.org/rstudio/httpuv) [](https://ci.appveyor.com/project/rstudio/httpuv)
httpuv provides low-level socket and protocol support for handling
HTTP and WebSocket requests directly from within R. It is primarily intended
as a building block for other packages, rather than making it particularly
easy to create complete web applications using httpuv alone. httpuv is built
on top of the [libuv](https://github.com/joyent/libuv) and [http-parser](https://github.com/joyent/http-parser) C libraries, both of which were developed
by Joyent, Inc.
## Installing
You can install the stable version from CRAN, or the development version using **devtools**:
```r
# install from CRAN
install.packages("httpuv")
# or if you want to test the development version here
if (!require("devtools")) install.packages("devtools")
devtools::install_github("rstudio/httpuv")
```
Since httpuv contains C code, you'll need to make sure you're set up to install packages.
Follow the instructions at http://www.rstudio.com/ide/docs/packages/prerequisites
---
## Debugging builds
httpuv can be built with debugging options enabled. This can be done by uncommenting these lines in src/Makevars, and then installing. The first one enables thread assertions, to ensure that code is running on the correct thread; if not. The second one enables tracing statements: httpuv will print lots of messages when various events occur.
```
PKG_CPPFLAGS += -DDEBUG_THREAD -UNDEBUG
PKG_CPPFLAGS += -DDEBUG_TRACE
```
To install it directly from Github with these options, you can use `with_makevars`, like this:
```R
withr::with_makevars(
c(PKG_CPPFLAGS="-DDEBUG_TRACE -DDEBUG_THREAD -UNDEBUG"), {
devtools::install_github("rstudio/httpuv")
}, assignment = "+="
)
```
© 2013-2018 RStudio, Inc.
|