Fixing reading of the relative URL in RommConnection
This commit is contained in:
parent
651dfc63f4
commit
e166c69b58
@ -67,10 +67,7 @@ export class RoomConnection implements RoomConnection {
|
|||||||
* @param roomId The ID of the room in the form "_/[instance]/[map_url]" or "@/[org]/[event]/[map]"
|
* @param roomId The ID of the room in the form "_/[instance]/[map_url]" or "@/[org]/[event]/[map]"
|
||||||
*/
|
*/
|
||||||
public constructor(token: string|null, roomId: string, name: string, characterLayers: string[], position: PositionInterface, viewport: ViewportInterface) {
|
public constructor(token: string|null, roomId: string, name: string, characterLayers: string[], position: PositionInterface, viewport: ViewportInterface) {
|
||||||
let url = PUSHER_URL;
|
let url = new URL(PUSHER_URL, window.location.toString()).toString();
|
||||||
if (url.startsWith('//')) {
|
|
||||||
url = window.location.protocol+url;
|
|
||||||
}
|
|
||||||
url = url.replace('http://', 'ws://').replace('https://', 'wss://');
|
url = url.replace('http://', 'ws://').replace('https://', 'wss://');
|
||||||
url += '/room';
|
url += '/room';
|
||||||
url += '?roomId='+(roomId ?encodeURIComponent(roomId):'');
|
url += '?roomId='+(roomId ?encodeURIComponent(roomId):'');
|
||||||
|
Loading…
Reference in New Issue
Block a user