Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
...
Code Block |
---|
CreateObject("roHttpServer", parameters As roAssociativeArray) |
Currently, the The associative array can contain a single parameterthe following parameters:
[int] port
: The port number of the embedded web server[roAssociativeArray] http
: A set of HTTPS configuration parameters:
-
[string] key_file
: The name of a file containing the private key in PEM format. If neither thepassphrase
norobfuscated_passphrase
are passed, then the key file must be unencrypted. [string] certificate_file
: The name of a file containing the certificate in PEM format[string] passphrase
: The passphrase to decrypt the key file[string] obfuscated_passphrase
: The obfuscated passphrase to decrypt the key file. Contact support@brightsign.biz to learn more about generating a key for obfuscation and storing it on the player.
-
Note | ||
---|---|---|
| ||
If the key and certificate are contained in a single file, it may be passed as the |
Code Block | ||
---|---|---|
| ||
server = CreateObject("roHttpServer", { port: 443, http: { certificate_file: "cert.pem", passphrase: "sekrit" } }) |
ifHttpServer
Each “Add” handler method described below takes an associative array as its parameter. Values in the associative array specify how the handler behaves. See the table at the end of this section for common key:value
pairs.
...
The following table describes common key:value pairs for "Add" handler methods:
Name | Applies to | Value |
url_path | All | The path for which the handler method will be used |
user_data | GetFromEvent() | A user-defined value that can be retrieved by calling roHttpEvent.GetUserData() |
method | AddMethodFromEvent() | The HTTP method associated with the generated roHttpEvent. The method type can then be retrieved using roHttpEvent.GetMethod(). |
passwords | All | An associative array that contains a mapping between usernames and passwords |
auth | All | The authentication type to use when passwords are set. This value can be either "basic" or "digest". The value defaults to “digest” if not specified. |
realm | All | The authentication realm, which will be displayed by web browsers when prompting for a username and password |
headers | GetFromFile() | An associative array that contains arbitrary headers to be included with the automated response |
content_type | GetFromFile() | The contents of the "Content-Type" header that is included with the automated response. This may not be set at the same time as the headers member. You can set both the MIME type and character set together (e.g. "text/plain; charset=utf-8") |
body | GetFromString() | The response body |
filename | GetFromFile() | The path to the file used for the response body. |
destination_directory | PostToFile() | The path to the directory used for the temporary file containing the request body. A random filename will be generated automatically. |
ifMessagePort
SetPort(port As roMessagePort)
...