When a CSPro application runs, a
local web server is launched that can serve content located on the local file system or stored in memory. In a variety of contexts, CSPro creates URLs, referred to as "localhost URLs," that are handled by the local web server. Typically these URLs are valid as long as the CSPro application is running, but some expire after a period of time. All localhost URLs are inaccessible once the CSPro application stops, as the local web server is disconnected at that point.
As an example, when a
templated report is displayed, CSPro evaluates the report content and creates a localhost URL that serves the content that is stored in memory. That URL is displayed in a web view, and when that web view closes, the localhost URL is released and is no long valid.
Most users will not need to create localhost URLs directly, but for advanced applications, particularly ones that make use of
HTML or use the
Action Invoker from a
web view, you may need to map content so that is accessible from another domain. The
Localhost namespace, part of the Action Invoker, provides actions to create localhost URLs from
files,
text, and
binary symbol data.
On Windows, the local web server uses
localhost as the host and chooses a dynamic port, checking for one that is not in use. You can try to have CSPro use a
specific port, but if that port is in use, a different one will be used. Other programs can access data using the localhost URL as the local web server is accessible to all Windows programs. A localhost URL created on Windows looks similar to:
http://localhost:58651/vf/1/vfsC:/Program%20Files%20(x86)/CSPro%208.0/readme.txt
On Android, a true local web server is not available, so instead CSPro uses
WebViewAssetLoader to simulate a web server. Other Android applications cannot access data using localhost URLs as they are only valid from web views from within the
Android CSEntry application. A localhost URL created on Android looks similar to:
https://appassets.androidplatform.net/lfs/1/storage/emulated/csentry/sync.log