Title: | 'SciViews' - HTTP Server |
---|---|
Description: | A simple HTTP server allows to connect GUI clients to R. |
Authors: | Philippe Grosjean [aut, cre] |
Maintainer: | Philippe Grosjean <[email protected]> |
License: | GPL-2 |
Version: | 1.0.4 |
Built: | 2024-10-26 02:54:45 UTC |
Source: | https://github.com/SciViews/svHttp |
Get list of all names of clients that already connected to the http server
http_server_clients() HttpClientsNames()
http_server_clients() HttpClientsNames()
A character vector with the name of currently connected clients.
start_http_server()
for a complete example.
library(svHttp) http_server_clients()
library(svHttp) http_server_clients()
Get or change the name of the HTTP server
http_server_name(name) HttpServerName(name)
http_server_name(name) HttpServerName(name)
name |
the name given to the SciViews server. By default, it is |
A character vector with the name of the HTTP server.
start_http_server()
for a complete example.
http_server_name()
http_server_name()
Get or change the port of the HTTP server
http_server_port(port) HttpServerPort(port)
http_server_port(port) HttpServerPort(port)
port |
port on which the server should run (both help and SciViews). By default, it is port 8888. Note that this server runs only locally and can only serve requests from 127.0.0.1 (because communication is not crypted). |
A number with the port of the HTTP server.
start_http_server()
for a complete example.
http_server_port()
http_server_port()
Get or change http server options
par_http_server(client, ...) parHttp(client, ...)
par_http_server(client, ...) parHttp(client, ...)
client |
the name of one client. A client that does not identify
itself is named |
... |
named arguments specifying options to set or change. |
An environment that contains the whole configuration is returned invisibly.
Possible named arguments (with their default values) are: prompt = ":> "
for the server prompt, continue = ":+ "
for the continuation prompt when
multiline instructions are send, code = ""
for current partial code in
multiline mode, last = ""
for a string to add at the end of each
evaluation, echo = FALSE
to echo commands at the R console or terminal,
multiline = TRUE
to allow multiline mode, bare = TRUE
a bare mode that
inactivates all other options (the server is always started in bare mode).
start_http_server()
for a complete example.
Turn the default R help HTTP server into a RJSONp SciViews server (while still serving help pages, of course).
start_http_server(port = http_server_port(), name = http_server_name()) startHttpServer(port = http_server_port(), name = http_server_name())
start_http_server(port = http_server_port(), name = http_server_name()) startHttpServer(port = http_server_port(), name = http_server_name())
port |
port on which the server should run (both help and SciViews). By default, it is port 8888. Note that this server runs only locally and can only serve requests from 127.0.0.1 (because communication is not crypted). |
name |
the name given to the SciViews server. By default, it is |
An integer indicating the port used.
svSocket::start_socket_server()
## Not run: library(svHttp) # Try to start the HTTP server on default port with default name res <- try(start_http_server(), silent = TRUE) if (!inherits(res, "try-error")) { # Get the port http_server_port() # Get the name http_server_name() # Get the list of clients... empty, unless you connect a client in between http_server_clients() } # Stop the server now stop_http_server() ## End(Not run)
## Not run: library(svHttp) # Try to start the HTTP server on default port with default name res <- try(start_http_server(), silent = TRUE) if (!inherits(res, "try-error")) { # Get the port http_server_port() # Get the name http_server_name() # Get the list of clients... empty, unless you connect a client in between http_server_clients() } # Stop the server now stop_http_server() ## End(Not run)
Stop the SciViews and R HTTP server and eliminate all tracks
stop_http_server(remove.clients = FALSE) stopHttpSever(remove.clients = FALSE)
stop_http_server(remove.clients = FALSE) stopHttpSever(remove.clients = FALSE)
remove.clients |
do we remove also persistent data for the clients,
|
A number with the port of the HTTP server.
start_http_server()
for a complete example.