Allow serving other than root of site, fixes #249
parent
02b6c617c5
commit
2373bf44d8
|
|
@ -129,7 +129,8 @@ export default class RoomClient
|
|||
produce,
|
||||
forceTcp,
|
||||
displayName,
|
||||
muted
|
||||
muted,
|
||||
basePath
|
||||
} = {})
|
||||
{
|
||||
if (!peerId)
|
||||
|
|
@ -152,6 +153,9 @@ export default class RoomClient
|
|||
// Whether we force TCP
|
||||
this._forceTcp = forceTcp;
|
||||
|
||||
// URL basepath
|
||||
this._basePath = basePath;
|
||||
|
||||
// Use displayName
|
||||
if (displayName)
|
||||
store.dispatch(settingsActions.setDisplayName(displayName));
|
||||
|
|
@ -1719,7 +1723,7 @@ export default class RoomClient
|
|||
|
||||
this._screenSharing = ScreenShare.create(this._device);
|
||||
|
||||
this._signalingSocket = io(this._signalingUrl);
|
||||
this._signalingSocket = io(this._signalingUrl, { path: this._basePath });
|
||||
|
||||
this._spotlights = new Spotlights(this._maxSpotlights, this._signalingSocket);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,13 @@ function run()
|
|||
const displayName = parameters.get('displayName');
|
||||
const muted = parameters.get('muted') === 'true';
|
||||
|
||||
const { pathname } = window.location;
|
||||
|
||||
let basePath = pathname.substring(0, pathname.lastIndexOf('/'));
|
||||
|
||||
if (!basePath)
|
||||
basePath = '/';
|
||||
|
||||
// Get current device.
|
||||
const device = deviceInfo();
|
||||
|
||||
|
|
@ -134,7 +141,8 @@ function run()
|
|||
produce,
|
||||
forceTcp,
|
||||
displayName,
|
||||
muted
|
||||
muted,
|
||||
basePath
|
||||
});
|
||||
|
||||
global.CLIENT = roomClient;
|
||||
|
|
@ -146,7 +154,7 @@ function run()
|
|||
<PersistGate loading={<LoadingView />} persistor={persistor}>
|
||||
<RoomContext.Provider value={roomClient}>
|
||||
<SnackbarProvider>
|
||||
<Router>
|
||||
<Router basename={basePath}>
|
||||
<Suspense fallback={<LoadingView />}>
|
||||
<React.Fragment>
|
||||
<Route exact path='/' component={ChooseRoom} />
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ function isPathAlreadyTaken(url)
|
|||
*/
|
||||
async function runWebSocketServer()
|
||||
{
|
||||
io = require('socket.io')(mainListener);
|
||||
io = require('socket.io')(mainListener, { path: '/' });
|
||||
|
||||
io.use(
|
||||
sharedSession(session, {
|
||||
|
|
|
|||
Loading…
Reference in New Issue