File Plugin
The file plugin enables the Universal Messaging realm server to serve
static web pages. This can be used for example to have the realm server serve
applets and supported files without the need for a dedicated web server. For
example, if you are running a file plugin on your realm server host called
webhost
, on an nhp interface running on port 80, you
could type in a URL within a web browser
http://webhost:80/index.html which
will return the index page defined within the file plugin's base path
directory.
This enables the realm server to act as a web server and can even be used to serve applets to client browsers that may directly communicate with the realm server and publish and consume events from channels.
Configuration
Once you have created the file plugin on the interface you require it on, you can then select it from the Plugins panel for the selected interface and enter values as you wish for the configuration parameters.
The file plugin requires configuration information defining its behavior as well as the location of the files it is required to serve to the clients. Below is a table that shows each configuration parameter and describes what it is used for.
Parameter Name | Description | Default Value |
---|---|---|
BufferSize | Size of the internal buffer to use to send the data. | 1024 |
BasePath | Path used to locate the files. | The
UniversalMessaging/doc
directory under the product installation directory.
|
DefaultName | If no file name is specified which file should be returned. | index.html |
FileNotFoundPage | Name of the file to send when file cannot be located | None. |
UserFile | Name of the file containing the usernames and passwords. | None. |
Security Realm | Name of the authentication realm | None. |
MimeType | Name of the file to load the mime type information from. The format of this file is : <mimetype> <fileExtension> | Built in types used. |
CachedObjects | Number of objects to store in the cache | 100 |
CacheObjectSize | Size in bytes that can be stored in the cache | 20K |
SeparateAccessandErrorLogs | Choose true to have separate log files for the access and error logs. | FALSE |
For example, on the
Comms > Interfaces tab, you can have an nhp
interface running on port 9000. This interface has a file plugin configured
with the default settings and its URL path is
/
. The default BasePath setting is the
UniversalMessaging/doc
directory in the file hierarchy for your local product installation, which is
where the default product installation places the Universal Messaging API docs.
Once the plugin is created, you can click the
Apply button, which will restart the interface
and enable the new file plugin.
From a browser, it is now possible to enter the URL
http://localhost:9000/
which will then render the
default
index.html
page from the
UniversalMessaging/doc
directory for the API docs.