Skip to content

Upgrading

Percs edited this page Mar 15, 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.

import { SetTransport } from '@mercuryworkshop/bare-mux';

SetTransport("EpxMod.EpoxyClient", { wisp: "wss://wisp.mercurywork.shop/" });
SetTransport("BareMod.BareClient", "https://example.com/bare/");

If not using a bundler, include the bare.cjs file in releases and call BareMux.SetTransport from the document.

Clone this wiki locally