This commit is contained in:
Your Name
2024-02-16 18:04:40 -06:00
parent a0af73ebdf
commit 915c7554e3

View File

@@ -6,8 +6,14 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
let host = window.location.host;
if (host.indexOf(":") != -1) {
host = host.substr(0,host.indexOf(":"));
}
// Replace 'ws://localhost/ws' with your WebSocket server address // Replace 'ws://localhost/ws' with your WebSocket server address
var ws = new WebSocket('ws://'+window.location.host+':1025/ws'); var ws = new WebSocket('ws://'+host+':1025/ws');
ws.onopen = function() { ws.onopen = function() {
console.log('WebSocket connection established'); console.log('WebSocket connection established');