1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 19:07:06 +00:00
Files
kararas_iris/_examples/websocket/gorilla-filewatch/views/home.html
Gerasimos (Makis) Maropoulos dfa08041a1 add a raw gorilla websocket example
2020-08-02 21:22:42 +03:00

22 lines
710 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Example</title>
</head>
<body>
<pre id="fileData">{{.Data}}</pre>
<script type="text/javascript">
(function() {
var data = document.getElementById("fileData");
var conn = new WebSocket("ws://{{.Host}}/ws?lastMod={{.LastMod}}");
conn.onclose = function(evt) {
data.textContent = 'Connection closed';
}
conn.onmessage = function(evt) {
console.log('file updated');
data.textContent = evt.data;
}
})();
</script>
</body>
</html>