mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 06:40:53 +00:00
23 lines
563 B
HTML
23 lines
563 B
HTML
<body>
|
|
<h2>WebSocket Test</h2>
|
|
<script>
|
|
var ws = new WebSocket("ws://localhost:8888/sailingserver/websockettest");
|
|
ws.onopen = function()
|
|
{
|
|
// Web Socket is connected, send data using send()
|
|
ws.send("Message to send");
|
|
alert("Message is sent...");
|
|
};
|
|
ws.onmessage = function (evt)
|
|
{
|
|
var received_msg = evt.data;
|
|
alert("Message is received...");
|
|
};
|
|
ws.onclose = function()
|
|
{
|
|
// websocket is closed.
|
|
alert("Connection is closed...");
|
|
};
|
|
</script>
|
|
</body>
|