HTTP Server
http.server.api_enabled
Abbreviation | ht s a |
Access | get/set |
Description
Enable the HTTP Server RESTful API. See Networking and Security, HTTP Server RESTful API.
The API is enabled by default, so enabling the HTTP server with http.server.enabled also allows access to the API. To disable HTTP RESTful API calls when the HTTP server is running, set http.server.api_enabled
to 0
.
Arguments
<0/1>
Default
1
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.api_enabled
1
Set example
> set ht s a 0
Set OK
http.server.cors_origin
Abbreviation | ht s c |
Access | get/set |
Description
Specifies origins for which the web browser same-origin policy is relaxed.
If <origin>
is set to an empty string, then CORS is completely disabled.
For requests without credentials, a value of *
acts as a wildcard, allowing any origin to access the resource.
See HTTP Server RESTful API, CORS.
Arguments
<origin>
Default
""
(empty string). To set the http.server.cors_origin
variable to the empty string, supply an argument with two double quotes: ""
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.cors_origin
Set example
> set ht s c *
Set OK
http.server.denied_filename
Abbreviation | ht s d |
Access | get/set |
Description
Specify the file name of the page to be displayed in the event that the HTTP server denies authentication.
Arguments
<filename>
Default
''
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.denied_filename
Set example
> set ht s d access_denied.html
Set OK
http.server.enabled
Abbreviation | ht s e |
Access | get/set |
Description
Enable the HTTP server. See Networking and Security, HTTP Server RESTful API.
Arguments
<1/0>
Default
0
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s e
0
Set example
> set ht s e 1
Set OK
http.server.interface
Abbreviation | ht s i |
Access | get/set |
Description
Specifies the network interface used by the HTTP server. See Networking and Security, HTTP Server RESTful API.
Arguments
<default/softap/wlan>
Default
default
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.interface
default
Set example
> set ht s i wlan
Set OK
http.server.max_clients
Abbreviation | ht s m |
Access | get/set |
Description
Specifies the maximum number of clients the HTTP server allows to connect.
Restricting connected clients may be necessary to limit memory usage. See Memory.
Arguments
<clients>
Default
3
Range: 1 - 8
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.max_clients
3
Set example
> set ht s m 1
Set OK
http.server.notfound_filename
Abbreviation | ht s n |
Access | get/set |
Description
Specifies the filename of the web page to be displayed in the event that the HTTP server reports a 404 - not found error.
<filename>
Default
''
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.notfound_filename
Set example
> set ht s n notfound.html
Set OK
http.server.password
Abbreviation | ht s w |
Access | get/set |
Description
Set the password of the http server. The username MUST be set as well for the http server to start.
See HTTP Server Security and Authorization.
Arguments
<password>
Default
null
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s w
secretpassword
Set example
> set ht s w secretpassword
Set OK
http.server.port
Abbreviation | ht s p |
Access | get/set |
Description
Set the port on which the HTTP server listens. See Networking and Security, HTTP Server RESTful API.
Arguments
<listening port>
Default
80
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s p
80
Set example
> set http.server.port 8080
Set OK
http.server.root_filename
Abbreviation | ht s r |
Access | get/set |
Description
This sets or gets the root file of the HTTP server. If a plain request to
See Networking and Security, HTTP Server RESTful API.
Arguments
<filename>
Default
/setup/index.html
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s r
/setup/index.html
Set example
> set http.server.root_filename /setup/home.html
Set OK
http.server.tls_cert
Abbreviation | ht s l |
Access | get/set |
Description
The server TLS CA certificate filename.
Arguments
<filename>
Default
null
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s c
mycert.pem
Set example
> set ht s c mycert.pem
Set OK
http.server.tls_client_log
Abbreviation | ht s g |
Access | get |
Description
Return list of recently connected clients. Up to 8 clients are logged. When the log contains 8 clients and a new client is added, the oldest client is removed. Requires http.server.tls_log_clients to be enabled.
Arguments
-
Default
null
Supported Platforms
Get example
> get http.server.tls_client_log
! # Timestamp Common Name
# 0 1422233232123 name@email.com
# 1 1422233232123 name2@email.com
Note: The timestamp shows the last time the client issued an HTTP request to the server, as system UTC time in milliseconds.
http.server.tls_enabled
Abbreviation | ht s t |
Access | get/set |
Description
Enable server Transport Level Security (TLS).
Arguments
<1/0>
Default
0
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s t
0
Set example
> set ht s t 1
Set OK
http.server.tls_key
Abbreviation | ht s k |
Access | get/set |
The server TLS certificate key filename.
Arguments
<filename>
Default
null
Get example
> get ht s k
mycert.key
Set example
> set ht s k mycert.key
Set OK
http.server.tls_log_clients
Abbreviation | ht s o |
Access | get/set |
Properties
- network_restart to apply change
Supported Platforms
Description
Enable/disable TLS client logging. http.server.tls_verify_peer must be enabled for this feature.
See http.server.tls_client_log
Arguments
<0|false/1|true>
Default
false
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.tls_log_clients
0
Get example
> set http.server.tls_log_clients 1
Set OK
http.server.tls_verify_peer
Abbreviation | ht s v |
Access | get/set |
Description
When this variable is set, a connecting client must provide a valid TLS certificate that the server validates. The client is disconnected if the provided certifcate is invalid. Note: The http.server.tls_cert variable must be set if using this feature.
Arguments
<0/1>
Default
0
Properties
- network_restart to apply change
Supported Platforms
Get example
> get ht s v
0
Set example
> set ht s v 1
Set OK
http.server.username
Abbreviation | ht s u |
Access | get/set |
Description
Set the username of the http server. The password MUST be set as well for the http server to start.
See HTTP Server Security and Authorization.
Arguments
<username>
Default
null
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.username
cyrano
Set example
> set ht s u cyrano
Set OK
http.server.ws_connected_gpio
Abbreviation | ht s x |
Access | get/set |
Description
The GPIO used to indicate whether a websocket stream is connected. It is asserted when one or more websocket streams are open.
Note: Set to -1
to disable feature and free assigned GPIO.
See also system.oob.gpio.
Arguments
<gpio #>
Default
-1
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.ws_connected_gpio
-1
Set example
> set http.server.ws_connected_gpio 9
Set OK
> get gp u
! # Description
...
# 9 http.server.ws_connected_gpio
...
http.server.ws_data_gpio
Abbreviation | ht s y |
Access | get/set |
Description
The GPIO used to indicate whether a websocket stream has data available to read. It is asserted when one or more websocket streams have data to be read.
See also system.oob.gpio.
Note: Set to -1
to disable feature and free assigned GPIO.
Arguments
<gpio #>
Default
-1
Properties
- network_restart to apply change
Supported Platforms
Get example
> get http.server.ws_data_gpio
-1
Set example
> set http.server.ws_data_gpio 9
Set OK
> get gp u
! # Description
...
# 9 http.server.ws_data_gpio
...