You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Percs edited this page Apr 10, 2024
·
18 revisions
Picking a transport
Newer versions of Ultraviolet use bare-mux, a way to switch bare clients easily. To do this, you must pick a transport to install and use on your service. Some examples of ones are EpoxyTransport, CurlTransport, and Bare-Client.
Adding the transport
Transports run in the service worker, which requires you to import them into the service worker. This is as easy as downloading the transport and importing it into your existing service worker like shown below. This should be imported in the main thread.
importScripts('/path/to/transport/index.js');
You can have multiple transports imported and switch between them using bare-mux.
Switching transports
If using a bundler, it is as easy as calling SetTransport imported from bare-mux.