workWithSessions
This setting can be set to a boolean flag that specifies whether the Work with Profound.js Sessions interface is enabled.
The default value is true. To disable the interface, use the following:
workWithSessions: false
When enabled, the interface is accessed using the following URL: http://server:port/sessions, where server is the Profound.js server name or IP address, and port is the Profound.js port number.
The Work with Sessions interface shows a list of active Profound.js sessions.
Click here for information on how to modify this setting.
Adding security
By default, the page is password-protected on IBM i servers, but is not password protected on non-IBM i servers.
To add password protection on servers like Windows or Linux, specify the workWithSessions configuration option as an object with a credentials property. For example:
workWithSessions: {
enabled: true,
credentials: "C:\my-project\sessions-credentials"
}
The basic authentication credentials file is created by the "store_credentials.js" command-line utility. You can find an example of how to use the "store_credentials.js" command line utility here.
Multiple Profound.js Servers
If your environment uses a load balancer with multiple Profound.js servers, you can enable a combined view of sessions on all servers by specifying an object with a servers array for the workWithSessions configuration. For example:
workWithSessions: {
enabled: true,
servers: [
"http://server1:8081",
"http://server2:8082"
]
}
With this configuration, the servers must be able to reach each other on the network. If each server is configured with a full list of servers used by the application, then the combined Work with Profound.js Sessions interface (/sessions URL) can be accessed from any Profound.js server.
The servers can also be specified with http request options, as defined by the pjs.httpRequest() API. For example:
Dynamic Servers
If the list of servers is dynamic, the servers property can be specified as a JavaScript function that returns an array of servers dynamically.
The function can either be synchronous or an async function.