From b458b4ef1be93161cf2bda250be109fd6a0a5ffe Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Fri, 22 May 2020 21:21:04 -0700
Subject: port extensibility fixes

---
 src/client/views/Main.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 17c001971..6878658a8 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -5,12 +5,16 @@ import * as ReactDOM from 'react-dom';
 import * as React from 'react';
 import { DocServer } from "../DocServer";
 import { AssignAllExtensions } from "../../extensions/General/Extensions";
+import { Networking } from "../Network";
 
 AssignAllExtensions();
 
+export let resolvedPorts: { server: number, socket: number };
+
 (async () => {
     const info = await CurrentUserUtils.loadCurrentUser();
-    DocServer.init(window.location.protocol, window.location.hostname, 4321, info.email);
+    resolvedPorts = JSON.parse(await Networking.FetchFromServer("/resolvedPorts"));
+    DocServer.init(window.location.protocol, window.location.hostname, resolvedPorts.socket, info.email);
     await Docs.Prototypes.initialize();
     if (info.id !== "__guest__") {
         // a guest will not have an id registered
-- 
cgit v1.2.3-70-g09d2

