PrismarineJS/prismarine-viewer

Browser-side support for path prefix is missing.

kashalls opened this issue · 2 comments

In late 2020, support for prefixes was added to the bot-side functionality. See here

We are, however, missing support for it in the browser-side.
https://github.com/PrismarineJS/prismarine-viewer/blob/master/lib/index.js#L10

It should be as simple as adding an object to the io() function like:

const socket = io({
  path: customPrefix ? `${customPrefix}/socket.io/` : '/socket.io/'
}

Question is how do you want to implement this, as from what I see is that the browser doesn't pull any server options.

SocketIO Client Docs

Maybe a check for window.prismarineViewerPrefix? It'd be defined somewhere before prismarine-viewer loads on the page in the users' code.

Maybe a check for window.prismarineViewerPrefix? It'd be defined somewhere before prismarine-viewer loads on the page in the users' code.

We can add that, where do you want to implement it at?