Agent-TCLI-Package-Net
view release on metacpan or search on metacpan
lib/Agent/TCLI/Package/Net/HTTPD.pm view on Meta::CPAN
expression. It should not include the delimeters or be provided in
qr() form.
type: Param
---
Agent::TCLI::Parameter:
name: logging
help: Turn on logging to the Tail command line queue
manual: >
The logging switch turns on logging to the line queue monitored by the
Tail command. This does not write to logs disk. One may then set up
Tail tests for specific URI's to determine exactly which ones got through.
To turn off, use no_logging.
By default the line queue will only hold 10 lines so memory cannot
accidentally be exhausted.
type: Switch
---
Agent::TCLI::Parameter:
name: response
aliases: resp
constraints:
- ASCII
-
- IN_ARRAY
- OK200
- NA404
- BeGone
default: OK200
help: The desired response
manual: >
The response must be one of the pre-defined responses. Currently these are:
OK200, NA404, BeGone.
The default is OK200.
type: Param
---
Agent::TCLI::Parameter:
name: handlers
help: Show the active handlers
manual: >
The handlers are stored in a format compatible with PoCo::Server::SimpleHTTP.
The DIR is the regex and the EVENT is the response.
type: Switch
---
Agent::TCLI::Parameter:
name: ports
help: Show the active HTTPD ports
manual: >
This will show the active httpd ports.
type: Switch
---
Agent::TCLI::Command:
name: httpd
call_style: session
command: tcli_httpd
contexts:
ROOT: httpd
handler: establish_context
help: simple http web server
manual: >
httpd provides a simple web server that can respond to and log requests.
By default it responds with a Status code 404 to all requests. One may add
a select few other status code responses using regular expression pattern
matching if desired. One cannot change content, only status codes.
Httpd is useful for network testing situations where the response codes
are being monitored by the network.
topic: net
usage: httpd spawn port=8080
---
Agent::TCLI::Command:
name: spawn
call_style: session
command: tcli_httpd
contexts:
httpd: spawn
handler: spawn
help: starts an http server on a particular port
manual: >
The spawn command starts an httpd listener on a particular port. One
may enable more than one httpd listener so long as they are
using different ports.
The script must have root priviledges if the port is less than 1024.
parameters:
port:
address:
hostname:
required:
port:
topic: net
usage: httpd spawn port=8080
---
Agent::TCLI::Command:
name: stop
call_style: session
command: tcli_httpd
contexts:
httpd: stop
handler: stop
help: Stops a running http server on a particular port
manual: >
The stop command stops an httpd listener running on the specified port. It
will return an error if the port cannot be found in the list of servers
running.
parameters:
port:
required:
port:
topic: net
usage: httpd stop port=8080
---
Agent::TCLI::Command:
name: uri
call_style: session
command: tcli_httpd
contexts:
httpd: uri
handler: establish_context
help: adds or removes a uri regex from the httpd
manual: >
The httpd can be set to respond to different uri queries with this command.
topic: net
usage: httpd uri add regex=^/good/.* response=OK200
---
( run in 1.611 second using v1.01-cache-2.11-cpan-df04353d9ac )