Make a toxiproxyy client. This must be done before accessing the toxiproxy server. The default for arguments are controlled by environment variables (see Details) and values provided as arguments override these defaults.

toxiproxy_client(addr = NULL)

Arguments

addr

The value address including protocol and port, e.g., http://toxiproxy.example.com:8474. If not given, the default is the environment variable TOXIPROXY_ADDR.

Methods


api

Returns an api client object that can be used to directly interact with the toxiproxy server.
Usage:api()

server_version

Returns the server version as a numeric_version object.
Usage:server_version(refresh = FALSE)
Arguments:

  • refresh: Logical scalar indicating if the value should be refreshed from the server if it has already been retrieved, as it is not expected to change.

list

List information about all proxies on this server. Returns a data.frame.
Usage:list()

create

Create a new proxy.
Usage:create(name, upstream, listen = NULL, enabled = TRUE)
Arguments:

  • name: The name for the proxy

  • upstream: The address of the service to proxy. Can be given as a string in the format <host>:<port> or simply as a port number, in which case the host is assumed to be localhost.

  • listen: The address that the proxy should listen on. Can be given as a either a string in the format <host>:<port> or simply as a port, in which case the host will be set to the same host as the toxiproxy server (which is almost always what you want!). If omitted, the toxiproxy server will choose a random free port.

  • enabled: Logical scalar indicating if the proxy should be enabled after creation.


Value: Returns a toxiproxy_proxy object - see the help there for details of methods that can be used with that object.

reset

Enable all proxies and remove all toxics.
Usage:reset()

get

Get an existing proxy
Usage:get(name)
Arguments:

  • name: The name of the proxy to get


Value: Returns a toxiproxy_proxy object - see the help there for details of methods that can be used with that object.

remove

Remove a proxy
Usage:remove(name)
Arguments:

  • name: The name of the proxy to remove