ThingWorx WebSocket-based Edge MicroServer (WS EMS) and Lua Script Resource (LSR) > Configuring a Lua Script Resource > Configuring the Connnection from the LSR to the WS EMS
  
Configuring the Connnection from the LSR to the WS EMS
The sample configuration file, config.lua.example, for the Lua Script Resource (LSR) shows the properties to set for the connection between the LSR and the WS EMS. You should add these properties to your config.lua file:
scripts.rap_host = "<IP_address_for_WS_EMS>"
scripts.rap_port = "port_number_for_WS_EMS"
scripts.rap_ssl = true
scripts.rap_userid - "user_ID_for_WS_EMS_HTTP_Server"
scripts.rap_password = "some_encrypted_password"
scripts.rap_server_authenticate = true
scripts.fips_enabled = false
scripts.rap_cert_file = "path_to_CA_certificate_file"
scripts.rap_validate = true
scripts.rap_deny_selfsigned = true
* 
For examples of secure configurations for communications between the WS EMS and the LSR, see Setting Up Secure Communications for WS EMS and LSR. These examples are presented in order of least secure (testing purposes ONLY) to most secure (strongly recommended for production environments).
To learn how to encrypt Application Keys, passwords, and passphrases, see Encrypting Application Keys, Passwords, and Passphrases.
Wherever you see rap in the config.lua file, the property is referring to the WS EMS.
The following table lists and briefly describes the properties:
Property
Description
scripts.rap_host
The host name or IP address of the machine that is running the WS EMS.
scripts.rap_port
The port on which the WS EMS listens for connections from LSR clients.
scripts.rap_ssl
Whether to enable the use of SSL/TLS for the connection to the WS EMS. By default the value of this property is true.
scripts.rap_userid
The user id to present to the HTTP Server of the WS EMS for authentication.
scripts.rap_password
The password for that user, AES encrypted. For information about encrypting passwords, see Encrypting Application Keys, Passwords, and Passphrases.
scripts.rap_server_authenticate
Whether to require authentication
scripts.fips_enabled
If ssl is true, whether FIPS is also used for the connection. The default value is false. Note that if you want to use FIPS, make sure that you download the WS EMS distribution package that has fips in its name.
scripts.rap_cert_file
The path to the CA certificate on the machine that is running the LSR.
scripts.rap_validate
Whether to enable certificate validation when the LSR communicates with the WS EMS. The default value is true.
scripts.rap_deny_selfsigned
When certificate validation is enabled and the LSR initiates communication to the WS EMS, this property is checked. If the value of this property is trueand the WS EMS is using a self-signed certificate (such as the default one shipped with the WS EMS), the LSR will refuse to connect and log an error. The default value of this property is true.