PracowniaProgramowania/backend/go_websockets/static/index.html

25 lines
630 B
HTML
Raw Normal View History

2018-11-15 01:52:44 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Go WebSocket Tutorial</title>
</head>
<body>
<h2>Hello World</h2>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script>
<!-- socket io library ^ -->
<script>
const socket = io('http://localhost:5000/socket.io/');
socket.emit("chat message", "Heloooooooooo")
socket.on("chat message", (msg) => {
console.log(msg);
})
</script>
</body>
</html>