openvidu-server publicurl parameter bug fix on launch

pull/32/merge
pabloFuente 2018-03-14 13:05:26 +01:00
parent d4621422fc
commit bd8b1d5340
1 changed files with 7 additions and 2 deletions

View File

@ -182,8 +182,13 @@ public class OpenViduServer implements JsonRpcConfigurer {
int port = url.getPort(); int port = url.getPort();
type = "custom"; type = "custom";
OpenViduServer.publicUrl = publicUrl.replaceFirst("https://", "wss://");
OpenViduServer.publicUrl = publicUrl.replaceFirst("http://", "wss://"); if (publicUrl.startsWith("https://")) {
OpenViduServer.publicUrl = publicUrl.replace("https://", "wss://");
} else if (publicUrl.startsWith("http://")) {
OpenViduServer.publicUrl = publicUrl.replace("http://", "wss://");
}
openviduConf.setFinalUrl(url.toString()); openviduConf.setFinalUrl(url.toString());
if (!OpenViduServer.publicUrl.startsWith("wss://")) { if (!OpenViduServer.publicUrl.startsWith("wss://")) {