Functions | |
void | init () |
System initialization. Normally called at the beginning of all applications. More... | |
void | StartHttp (uint16_t port=80) |
Start the HTTP web server. More... | |
void | StartHttps (uint16_t ssl_port=443, uint16_t http_port=80) |
Start the HTTPS secure web server. More... | |
bool | WaitForActiveNetwork (uint32_t ticks_to_wait=120 *TICKS_PER_SECOND, int interface=-1) |
Wait for an active network connection on at least one interface. More... | |
void | EnableSecureConfigServer (bool bHSTS) |
Enable the minimal http config server to operate over TLS. More... | |
void EnableSecureConfigServer | ( | bool | bHSTS | ) |
Enable the minimal http config server to operate over TLS.
Due to the nature of the server operating on a non-standard HTTP port, a client (such as a webbrowser) cannot infer whether to utilize TLS unless explicitly told to do so. Therefore, the secure configuration server has two modes it can operate in: a less secure, more compliant manner that allows both plaintext and TLS secured transactions and a HSTS (Http Strict Transport Security) mode that will only respond to plaintext requests with a redirect indicating the TLS requirement.
bHSTS | Whether the SecureConfigServer should disallow non-secure requests |
void init | ( | ) |
System initialization. Normally called at the beginning of all applications.
Initialize the system including the following:
void StartHttp | ( | uint16_t | port = 80 | ) |
Start the HTTP web server.
If no parameters are specified it will listen on port 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page.
port | Listen port, defaults to port 80 |
RunConfigMirror | Enable configuration mirror, default is true |
Start the HTTP web server.
If no parameters are specified it will listen on port 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page.
port | Listen port, defaults to port 80 |
void StartHttps | ( | uint16_t | ssl_port = 443 , |
uint16_t | http_port = 80 |
||
) |
Start the HTTPS secure web server.
If no parameters are specified the web server will listen on ports 443 and 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page. If no user key is installed the default system key will be used.
ssl_port | Secure listen port, defaults to port 443 |
http_port | Non-secure listen port, defaults to port 80 |
RunConfigMirror | Enable configuration mirror, default is true |
If no parameters are specified the web server will listen on ports 443 and 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page. If no user key is installed the default system key will be used.
Default parameter values defined in init.h
ssl_port | Secure listen port, defaults to port 443 |
http_port | Non-secure listen port, defaults to port 80 |
bool WaitForActiveNetwork | ( | uint32_t | ticks_to_wait = 120 *TICKS_PER_SECOND , |
int | interface = -1 |
||
) |
Wait for an active network connection on at least one interface.
If DHCP is enabled it will wait for a lease. If static IP parameters are configured it will wait for link.
ticks_to_wait | Number of system time ticks to wait. Default is 120 seconds. |
interface | Interface number to check. Default is -1, which checks all interfaces. |