diff options
| author | Andy Rickert <andrew_rickert@brown.edu> | 2020-06-03 16:40:09 -0400 |
|---|---|---|
| committer | Andy Rickert <andrew_rickert@brown.edu> | 2020-06-03 16:40:09 -0400 |
| commit | 954948ddd511578af4ca2c50c960765a5a7bc637 (patch) | |
| tree | 16fafd254a5db95d5c39838d4313d7ddf59753af /src/client/DocServer.ts | |
| parent | 6d8d3c00587c43ae61392db4fe6915ee492c2e4a (diff) | |
| parent | 9588e56079f7e4ab98da1849f44996656649bc06 (diff) | |
merge
Diffstat (limited to 'src/client/DocServer.ts')
| -rw-r--r-- | src/client/DocServer.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 34ef502ad..c6b3fa61f 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -1,10 +1,10 @@ -import * as OpenSocket from 'socket.io-client'; +import * as io from 'socket.io-client'; import { MessageStore, YoutubeQueryTypes, GestureContent, MobileInkOverlayContent, UpdateMobileInkOverlayPositionContent, MobileDocumentUploadContent } from "./../server/Message"; -import { Opt, Doc } from '../new_fields/Doc'; +import { Opt, Doc } from '../fields/Doc'; import { Utils, emptyFunction } from '../Utils'; import { SerializationHelper } from './util/SerializationHelper'; -import { RefField } from '../new_fields/RefField'; -import { Id, HandleUpdate } from '../new_fields/FieldSymbols'; +import { RefField } from '../fields/RefField'; +import { Id, HandleUpdate } from '../fields/FieldSymbols'; import GestureOverlay from './views/GestureOverlay'; import MobileInkOverlay from '../mobile/MobileInkOverlay'; import { runInAction } from 'mobx'; @@ -108,7 +108,9 @@ export namespace DocServer { export function init(protocol: string, hostname: string, port: number, identifier: string) { _cache = {}; GUID = identifier; - _socket = OpenSocket(`${protocol}//${hostname}:${port}`); + protocol = protocol.startsWith("https") ? "wss" : "ws"; + _socket = io.connect(`${protocol}://${hostname}:${port}`); + // io.connect(`https://7f079dda.ngrok.io`);// if using ngrok, create a special address for the websocket _GetCachedRefField = _GetCachedRefFieldImpl; _GetRefField = _GetRefFieldImpl; |
