webserver.js Configuration

Configuration reference for the webserver.js backend, including the [webserverjs] config section entries, port settings, index page, and ULC UX forwarding.

The [webserverjs] Config Section

webserver.js is configured through the [webserverjs] section in the project configuration file. The available configuration options are largely the same as those of webclient_http.ctl and dashboard.ctl, but they must be placed in the [webserverjs] section instead of [wssServer] or [httpServer]. Dashboard-related settings that were previously in [httpServer] should also be moved to [webserverjs].

Port Configuration

The HTTPS port used by webserver.js is set via the httpsPort entry:

[webserverjs]
httpsPort = 8443

The default value is 8443. Change this value if another service already uses this port or if your deployment requires a different port assignment.

Note:
webserver.js supports HTTPS only. There is no httpPort configuration option — all connections are served over HTTPS.

Index Page

The indexPage entry defines which page is served as the default landing page. To serve the WinCC OA Dashboard, configure:

[webserverjs]
indexPage = "data/dashboard-wc/index.html"

Parallel Operation with webclient_http.ctl

When both webserver.js and the HTTP Server running webclient_http.ctl are active, two HTTP servers listen on different ports. In this configuration, the Dashboard can be opened from either port. However, this may lead to inconsistent results if the servers are configured differently or use different customizations. Always use the port configured for webserver.js when opening the Dashboard.

ULC UX Forwarding

webserver.js can forward ULC UX requests to the webclient_http.ctl handler. This is required for ULC UX functionality when using webserver.js as the backend.

To enable ULC UX forwarding, add the following entries to the [webserverjs] section:

[webserverjs]
ulcUxPort = 443
ulcUxHost = "localhost"
allowExternalResources = 1

The ulcUxPort and ulcUxHost specify the port and host of the HTTP Server instance running webclient_http.ctl.

The allowExternalResources entry must be set to 1 to allow embedding the ULC UX frame from a different host and/or port into the Dashboard.

On the HTTP Server side, CORS (Cross-Origin Resource Sharing) must be configured to allow requests from the webserver.js origin. Add the following entries to the [httpServer] section:

[httpServer]
accessControlAllowOrigin = "https://localhost:8443"
httpHeader = "Content-Security-Policy: frame-ancestors 'self' https://localhost:8443"
XFrameOptions = none

Adjust the server address and port number in these entries to match the httpsPort configured for webserver.js.

Configuration

The following example shows a complete [webserverjs] configuration with Dashboard access and ULC UX forwarding:

[webserverjs]
httpsPort = 8443
indexPage = "data/dashboard-wc/index.html"
ulcUxPort = 443
ulcUxHost = "localhost"
allowExternalResources = 1