API - createBrowserNetworkSource
This module is used inside a browser app to connect to a server-side Source.
You can use this module as a Protected Source or a Source. It will proxy the actual behavior of the remote Source, "Protected" or not.
Usage
const source = createBrowserNetworkSource({
authority: 'my.server.dev',
useSSL: true,
});
API
"authority" - the domain/host of the remote server, including port
"useSSL" - true if wss/https should be used instead of ws/http protocols
Implicit Options
If you pass `null` in for the authority or useSSL, the network client will infer this from the browser's current location.
const source = createBrowserNetworkSource({
authority: null,
useSSL: null,
});
// The browser will attempt to connect to the server it was loaded from