-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubscriber.html
More file actions
33 lines (31 loc) · 831 Bytes
/
subscriber.html
File metadata and controls
33 lines (31 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script src="/socket.io/socket.io.js"></script>
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
<script>
var socket = io.connect();
document.write("GGWP");
var userId = getParameterByName('username');
document.title = userId + " : Subscriber";
var xyz = {type: "CLIENT_ID", payload: userId};
socket.emit('toSocketConnection', xyz);
socket.on('message', function(data) {
console.log(data);
});
</script>
</body>
</html>