Skip to content

Commit

Permalink
Configura servidor de ws
Browse files Browse the repository at this point in the history
  • Loading branch information
weslley17w committed Sep 15, 2024
1 parent c5dce44 commit 0fe6a4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ <h2 class="mdc-dialog__title" id="my-dialog-title">Join room</h2>
</div>

<script>
const ws = new WebSocket('ws://localhost:8080');

const urlHost = window.location.host;
const wsUrl = (urlHost === 'webrt-f83c2.web.app') ? 'wss://web-rtc-i6u8.onrender.com:8080' : 'ws://localhost:8080';
const ws = new WebSocket(wsUrl);
const messages = document.getElementById('messages');
const messageInput = document.getElementById('messageInput');
const username = prompt("Digite seu nome:");
Expand Down

0 comments on commit 0fe6a4a

Please sign in to comment.