Allow specifying path for socket connections
Enhance and normalize endpoint customization via IUrlResolver.
In our scenario, we host r11s containers along with other microservices in a k8s cluster with an nginx gateway. The requirement is to use a single public endpoint and proxy all service HTTP and WS traffic through the gateway. For instance,
https://*.azure.net/api/proxy/collab/repos/{tenantId}
https://*.azure.net/api/proxy/collab/deltas/{tenantId}/{documentId}
wss://*.azure.net/api/proxy/collab/socket.io/?documentId={documentId}&tenantId={tenantId}
Currently (as of v0.30), a URL resolver is only capable of specifying endpoints for orderer, storage and delta storage services.
Where ordererUrl, in fact, can only be a base URL without a path as it's used in other places to format nested URLs, such as RouterliciousDocumentServiceFactory.
Ideal solution would be specifying a single orderer URL and let the Fluid driver infer the rest following a default convention.
Alternatively, tweak IFluidResolvedUrl to carry additional path parameter for socket connections, and fix the r11s document service factory to adhere to the same URL schema.
Happy new year! Any feedback on this issue? Thoughts or ideas?
@tanviraumi what are you thoughts?
I am not sure why specifying three separate endpoints becomes an issue. We can't have just one url since storage url can be totally separate from orderer url. Delta and orderer url are also mostly disjoint. Do you want to specify any specific path to orderer url to route your socket requests?
We need a method of specifying path in socket connection in DocumentDeltaConnection
const socket = io(
url,
{
...
path:"/api/proxy/collab/socket.io",
...
});
I think we can add an optional property to IFluidResolvedUrl. Feel free to send a PR
@alpaix - we should either find a way to propose a solution or close it, IMHO. Are you in position to raise a PR with proposal?
Will take a look
The workaround for this issue is to fork a driver that would allow customizing network endpoints and connection parameters. Will re-open if the driver approach is not sufficient.