-
Notifications
You must be signed in to change notification settings - Fork 1
Module thc_HttpDServer
This module provides a tiny HTTP server that allows taking control over the THC server, for example for debugging purposes. This HTTP debug server allows running Tcl commands on the HTC server, getting device states, getting files, etc. Once the HTTP debug server is started (see <thc_HttpDServer::Start>), it accepts the following HTTP requests:
Description | |
---|---|
help | Provides help |
eval | Evaluates a Tcl command sequence |
The HTTP requests can directly be performed from a web browser, or they can be issued by applications. Examples for HTTP requests:
http://192.168.1.21:8085/help
-> help: this help information
-> eval \<TclCommand>: Evaluate a Tcl command and returns the result
-> download \<File>: Download a file (from a browser)
-> show \<File>: Show a file (in a browser)
http://192.168.1.21:8085/eval array get State
-> MotionSalon,state 0 Light2nd,state 0 MultiSalon,temp 19.5 MultiSalon,battery 60
http://192.168.1.21:8085/eval JobsString
-> 45s:RrdLog 45s:U_1m 2m:RrdGph1D 42m:RrdGph1W 42m:U_1h 15h:EvalSun 16h:RrdGph1M
http://192.168.1.21:8085/file /var/thc/thc.log
-> ...
The HTTP debug server accepts only a single HTTP connection at a time. It doesn't provide any security or authentication and should therefore be disabled in an insecure environment.
Start the HTTP server. This command starts an HTTP server at the specified port. It accepts Tcl commands and scripts, evaluates them, and returns the result.
Parameters | Description |
---|---|
port | HTTP port |
HTTP server socket identifier
thc_HttpDServer::Start 8085
Closes a running HTTP server.
thc_HttpDServer::Stop
THC, Tight Home Control - See THC index register - THC repository on github.com/Drolla/thc