Webfakes web server options
server_opts(
remote = FALSE,
port = NULL,
num_threads = 1,
interfaces = "127.0.0.1",
enable_keep_alive = FALSE,
access_log_file = remote,
error_log_file = TRUE,
tcp_nodelay = FALSE,
throttle = Inf,
decode_url = TRUE,
ssl_certificate = NULL
)
Meta-option. If set to TRUE
, webfakes uses slightly
different defaults, that are more appropriate for a background
server process.
Port to start the web server on. Defaults to a randomly chosen port.
Number of request handler threads to use. Typically you don't need more than one thread, unless you run test cases in parallel or you make concurrent HTTP requests.
The network interfaces to listen on. Being a test web server, it defaults to the localhost. Only bind to a public interface if you know what you are doing. webfakes was not designed to serve public web pages.
Whether the server keeps connections alive.
TRUE
, FALSE
, or a path. See 'Logging'
below.
TRUE
, FALSE
, or a path. See 'Logging'
below.
if TRUE
then packages will be sent as soon as
possible, instead of waiting for a full buffer or timeout to occur.
Limit download speed for clients. If not Inf
,
then it is the maximum number of bytes per second, that is sent to
as connection.
Whether the server should automatically decode
URL-encodded URLs. If TRUE
(the default), /foo%2fbar
will be
converted to /foo/bar
automatically. If FALSE
, URLs as not
URL-decoded.
Path to the SSL certificate of the server, needed if you want to server HTTPS requests.
List of options that can be passed to webfakes_app$listen()
(see new_app()
), and new_app_process()
.
For access_log_file
, TRUE
means <log-dir>/access.log
.
For error_log_file
, TRUE
means <log-dir>/error.log
.
<log-dir>
is set to the contents of the WEBFAKES_LOG_DIR
environment variable, if it is set. Otherwise it is set to
<tmpdir>/webfakes
for local apps and <tmpdir>/<pid>/webfakes
for
remote apps (started with new_app_procss()
).
<tmpdir>
is the session temporary directory of the main process.
<pid>
is the process id of the subprocess.
# See the defaults
server_opts()
#> $remote
#> [1] FALSE
#>
#> $port
#> NULL
#>
#> $num_threads
#> [1] 1
#>
#> $interfaces
#> [1] "127.0.0.1"
#>
#> $enable_keep_alive
#> [1] FALSE
#>
#> $access_log_file
#> [1] NA
#>
#> $error_log_file
#> [1] "/tmp/Rtmp9G14Fn/webfakes/error.log"
#>
#> $tcp_nodelay
#> [1] FALSE
#>
#> $throttle
#> [1] Inf
#>
#> $decode_url
#> [1] TRUE
#>
#> $ssl_certificate
#> [1] "/tmp/Rtmp0cVTPM/temp_libpath2b288ef23a4b/webfakes/cert/localhost/server.pem"
#>