Configurable websocket address?

Enonic version: 7.7


We have XP running in Openshift with an F5 load balancer in front. After upgrading to XP 7.7 (from 7.2.3) and Data Toolbox 5.0.14 (from 3.0.1), we are experiencing problems with the Data Toolbox app. Apparently it cannot establish a websocket connection to the server. The problem seems to be that Data Toolbox and XP is running at a public address hosted by the load balancer, but the websocket address that it tries to connect to points directly at the openshift address where XP is hosted, which is not the domain used when logging in. The error message we get in the browser console is Error opening websocket connection and the Data Toolbox app fails to render.

In the response for the toolbox html page I notice that we get a configuration object in js:

        const config = {
            adminRestUrl: '/admin/rest',
            servicesUrl: '/admin/tool/systems.rcd.enonic.datatoolbox/data-toolbox/_/service/systems.rcd.enonic.datatoolbox',
            assetsUrl: '/admin/tool/systems.rcd.enonic.datatoolbox/data-toolbox/_/asset/systems.rcd.enonic.datatoolbox:00000179f14b4300',
            wsUrl: 'wss://',
            xpVersion: '7.7.0',
            appName: 'systems.rcd.enonic.datatoolbox'

The question is, would it be possible to configure/override the wsUrl in some way? Either to be relative to the current page or the exact url to be used?

Hmm… This sounds like a Data toolbox bug. However, can you confirm that you have setup XP vhosts for the /admin endpoint?

@gri FYI

Data Toolbox uses portalLib.url({path: '/admin/event', type: 'absolute'}). So this is more likely due to a configuration issue.
As tsi mentioned, I would first look at the Virtual Host configuration (Virtual hosts).
If not, there is maybe an issue with the redirection by the load balancer not setting the correct original hostname as a header when forwarding (X-Forwarded-Host) or something similar

1 Like

Thank you, we managed to fix the problem configuring X-Forwarded-Host and X-Forwarded-Port in the load balancer.