Why we are bringing this up
With the introduction of Gen 7, we have observed several URCaps failing in certain deployment scenarios because frontend code communicates with backend services using fixed hostnames, control box addresses, or the servicegateway hostname. While these approaches may appear to work in some environments, they are not supported for frontend contributions running in the browser and may lead to connectivity issues on Gen 7 systems.
To improve portability and compatibility across robot configurations, frontend contributions should use URLs, either through the contribution API or relative URLs.
Upcoming SDK documentation
We are currently expanding the SDK documentation with additional guidance and examples. Until that documentation becomes publicly available, the recommendations below can help avoid common connectivity issues.
Calling REST endpoints on the robot
A URCap frontend must never address a robot service by the IP address or DNS name of the control box, and must not use
the `servicegateway` hostname. The frontend runs in a browser, which may not resolve that internal name.
If the frontend contribution needs to do REST communication with a contributed backend, create a backend contribution
and set up the REST API using Ingress. Then use one of the following patterns.
Compute the URL with the contribution API (recommended for TypeScript frontends)
Use getContainerContributionURL(vendorID, urcapID, container-name, ingress-name). It returns a URL that matches the current browser session. See Creating a container backend Contribution.
this.backendUrl = this.applicationAPI.getContainerContributionURL(
VENDOR_ID, URCAP_ID, 'simple-docker-backend', 'rest-api'
);
this.httpClient.get(`http://${this.backendUrl}/status`);
Relative URLs (frontends in the browser)
Omit scheme, IP, and host. Use only the ingress path. The browser resolves it against the current session URL:
/<vendorID>/<urcapID>/<containerID>/<ingressID>/my-endpoint
Example:
this.httpClient.get('/universal-robots/simple-docker/simple-docker-backend/rest-api/status');