Skip to content
Snippets Groups Projects
Commit ef64e3ac authored by dario's avatar dario
Browse files

server: add static html/js files

parent d60b156d
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="/ws.js"></script>
</head>
<body>
index.html served
</body>
</html>
var ws = new WebSocket('ws://localhost:8000');
console.log(ws);
ws.onopen = function(e) {
console.log("Connection open...", e);
ws.send("hh");
};
ws.onmessage = function(e) {
if(typeof e.data === "string"){
console.log("String message received", e, e.data);
} else {
console.log("Other message received", e, e.data);
}
};
ws.onerror = function(e) {
console.log("WebSocket Error (dinge): " , e);
};
ws.onclose = function(e) {
console.log("Connection closed", e);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment