We don't want to depend on: 1) socket.io generated IDs because they change on server reconnect 2) simple-peer generated IDs because they change for every peer connection We generate a single ID when the call web page is refreshed and use that throughout the session (until page refresh). We keep relations of user-id to socket-id on the server side in memory and use that to get to the right socket. In the future this might be replaced with Redis to allow multiple nodes. If the server is restarted, but people have active calls, we want them to keep using the active peer connections and only connect to new peers. Ideally, we do not want to disturb the active peer connections, but peer connections might be restarted because the in-memory store will not have the information on for any peers in the room upon restart.
17 lines
486 B
HTML
17 lines
486 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Peer Call</title>
|
|
<%- include('./_header.html') %>
|
|
</head>
|
|
<body class="call">
|
|
<input type="hidden" id="baseUrl" value="<%= baseUrl %>">
|
|
<input type="hidden" id="callId" value="<%= callId %>">
|
|
<input type="hidden" id="iceServers" value='<%- JSON.stringify(iceServers) %>'>
|
|
<input type="hidden" id="userId" value="<%= userId %>">
|
|
<div id="container"></div>
|
|
|
|
<script src="<%= baseUrl + '/static/index.js' %>"></script>
|
|
</body>
|
|
</html>
|