Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
scripts
^Makefile$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ configure.log
.vscode
*.orig
docs
scripts/R-devel
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ Authors@R: c(
person("Trantor Standard Systems", role = "cph",
comment = "base64 implementation"),
person("Igor", "Sysoev", role = "cph",
comment = "http-parser")
comment = "http-parser"),
person(given = "Mauricio", family = "Vargas Sepulveda", role = "aut",
email = "m.vargas.sepulveda@gmail.com",
comment = c(ORCID = "0000-0003-1017-7574"))
)
Description: Provides low-level socket and protocol support for handling
HTTP and WebSocket requests directly from within R. It is primarily
Expand All @@ -60,7 +63,6 @@ Imports:
later (>= 0.8.0),
promises,
R6,
Rcpp (>= 1.0.7),
utils
Suggests:
callr,
Expand All @@ -70,20 +72,20 @@ Suggests:
websocket
LinkingTo:
later,
Rcpp
cpp11
Config/Needs/website: tidyverse/tidytemplate
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'
'cpp11.R'
'httpuv-package.R'
'httpuv.R'
'random_port.R'
'server.R'
'staticServer.R'
'static_paths.R'
'utils.R'
Config/roxygen2/version: 8.0.0
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
clean:
@Rscript -e 'devtools::clean_dll(".");'

install:
@Rscript -e 'devtools::install(".");'

STANDARDS := cxx17 cxx20 cxx23
COMPILERS := gcc clang

ALL_CHECKS := $(foreach std,$(STANDARDS),$(foreach comp,$(COMPILERS),check-$(std)-$(comp)))

check: $(ALL_CHECKS)

define run-check
check-$(1)-$(2):
@echo "Checking C++ code with $(1) standard and $(2) compiler"
# @$$(MAKE) install
./scripts/check_prepare.sh "$(1)" "$(2)"; \
if ! ./scripts/check_run.sh "$(1)" "$(2)"; then \
echo "Check failed"; \
./scripts/check_restore.sh "$(1)" "$(2)"; \
exit 1; \
fi; \
./scripts/check_restore.sh "$(1)" "$(2)"
endef

clang_format=`which clang-format-21`

format: $(shell find . -name '*.h') $(shell find . -name '*.hpp') $(shell find . -name '*.cpp')
@${clang_format} -i $?

build-r-devel:
@echo "Building R-devel from source"
./scripts/build_r_devel.sh

check-devel:
@echo "Checking with R-devel (CXX23, gcc)"
./scripts/check_r_devel.sh cxx23 gcc

$(foreach std,$(STANDARDS),$(foreach comp,$(COMPILERS),$(eval $(call run-check,$(std),$(comp)))))
$(foreach std,$(STANDARDS),$(eval check-$(std)-glang: check-$(std)-clang))
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export(stopAllServers)
export(stopDaemonizedServer)
export(stopServer)
importFrom(R6,R6Class)
importFrom(Rcpp,evalCpp)
importFrom(later,run_now)
importFrom(promises,"%...!%")
importFrom(promises,"%...>%")
Expand Down
147 changes: 0 additions & 147 deletions R/RcppExports.R

This file was deleted.

81 changes: 81 additions & 0 deletions R/cpp11.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Generated by cpp11: do not edit by hand

sendWSMessage <- function(conn, binary, message) {
invisible(.Call(`_httpuv_sendWSMessage`, conn, binary, message))
}

closeWS <- function(conn, code, reason) {
invisible(.Call(`_httpuv_closeWS`, conn, code, reason))
}

makeTcpServer <- function(host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) {
.Call(`_httpuv_makeTcpServer`, host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet)
}

makePipeServer <- function(name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) {
.Call(`_httpuv_makePipeServer`, name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet)
}

stopServer_ <- function(handle) {
invisible(.Call(`_httpuv_stopServer_`, handle))
}

getStaticPaths_ <- function(handle) {
.Call(`_httpuv_getStaticPaths_`, handle)
}

setStaticPaths_ <- function(handle, sp) {
.Call(`_httpuv_setStaticPaths_`, handle, sp)
}

removeStaticPaths_ <- function(handle, paths) {
.Call(`_httpuv_removeStaticPaths_`, handle, paths)
}

getStaticPathOptions_ <- function(handle) {
.Call(`_httpuv_getStaticPathOptions_`, handle)
}

setStaticPathOptions_ <- function(handle, opts) {
.Call(`_httpuv_setStaticPathOptions_`, handle, opts)
}

base64encode <- function(x) {
.Call(`_httpuv_base64encode`, x)
}

encodeURI_ <- function(value) {
.Call(`_httpuv_encodeURI_`, value)
}

encodeURIComponent_ <- function(value) {
.Call(`_httpuv_encodeURIComponent_`, value)
}

decodeURI_ <- function(value) {
.Call(`_httpuv_decodeURI_`, value)
}

decodeURIComponent_ <- function(value) {
.Call(`_httpuv_decodeURIComponent_`, value)
}

ipFamily_ <- function(ip) {
.Call(`_httpuv_ipFamily_`, ip)
}

invokeCppCallback <- function(data, callback_xptr) {
invisible(.Call(`_httpuv_invokeCppCallback`, data, callback_xptr))
}

getRNGState_ <- function() {
invisible(.Call(`_httpuv_getRNGState_`))
}

wsconn_address <- function(external_ptr) {
.Call(`_httpuv_wsconn_address`, external_ptr)
}

log_level <- function(level) {
.Call(`_httpuv_log_level`, level)
}
Loading