From fb35b84a65dfa3fce6fa68d1b729a0605da9f0a2 Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 13 Feb 2020 12:22:18 +0900 Subject: [PATCH] =?UTF-8?q?bugfix=20=EC=9B=B9=EC=86=8C=EC=BC=93=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=EC=8B=9C=20verinfo=20=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A7=91=EB=90=9C=20serverIP=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=91=EC=86=8D=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/environments/environment.daesang.prod.ts | 2 +- .../src/lib/services/protocol.service.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts index 3fbbcce2..d0e5ff2e 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts @@ -153,7 +153,7 @@ export const environment: Environment = { protocolModuleConfig: { hostConfig: { protocol: 'ws', - domain: 'dstalk.daesang.com', + domain: 'messenger2.daesang.com', port: 8080 }, urls: protocolUrls, diff --git a/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts b/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts index 4cdad47b..6506b87b 100644 --- a/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts +++ b/projects/ucap-webmessenger-protocol/src/lib/services/protocol.service.ts @@ -72,9 +72,16 @@ export class ProtocolService { public connect(serverIp: string | null = null): Observable { return new Observable(subscriber => { try { - this.socket$ = makeWebSocketObservable( - `${this.urls.base}${serverIp ? serverIp : ''}` - ); + let url = this.urls.base; + if (!!serverIp && serverIp.length > 0) { + url = `${ + this.moduleConfig.hostConfig.protocol + }://${serverIp}:${String(this.moduleConfig.hostConfig.port)}`; + } + + // console.log(`${this.urls.base}${serverIp ? serverIp : ''}`); + // console.log(url); + this.socket$ = makeWebSocketObservable(url); this.messages$ = this.socket$.pipe( switchMap(getResponses => { subscriber.next();