Skip to content

Commit

Permalink
fix(rtc): 修复正式环境下的语音服务器地址错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Nov 13, 2020
1 parent b213e32 commit 737197f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/rtc/urlFactory.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import config from '@shared/project.config';

let protooPort = 4443;

const hostname =
config.environment === 'development'
? 'rtc.moonrailgun.com'
: window.location.hostname;

if (hostname === 'test.mediasoup.org') protooPort = 4444;

export function getProtooUrl({ roomId, peerId, forceH264, forceVP9 }) {
let url = `wss://${hostname}:${protooPort}/?roomId=${roomId}&peerId=${peerId}`;
let url = `${config.url.rtc}/?roomId=${roomId}&peerId=${peerId}`;

if (forceH264) url = `${url}&forceH264=true`;
else if (forceVP9) url = `${url}&forceVP9=true`;
Expand Down
2 changes: 2 additions & 0 deletions src/shared/project.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ interface ProjectConfig {
};
url: {
api?: string;
rtc: string;
homepage: string;
goddessfantasy: string;
blog: string;
Expand Down Expand Up @@ -232,6 +233,7 @@ const config: ProjectConfig = {
'https://raw.githubusercontent.com/TRPGEngine/Client/master/src/app/package.json',
},
url: {
rtc: 'wss://rtc.moonrailgun.com:4443', // 语音服务器地址 不包括前缀
homepage: 'https://trpgdoc.moonrailgun.com/',
goddessfantasy: 'http://www.goddessfantasy.net/',
blog: 'https://trpgdoc.moonrailgun.com/blog/',
Expand Down

0 comments on commit 737197f

Please sign in to comment.