Skip to content

Commit 6086a14

Browse files
committed
add tip
1 parent e876f9f commit 6086a14

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/scala/com/timzaak/proxy/LogWebViewer.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ class LogWebViewer(certPath: Option[String])(using system: ActorSystem) {
5656
<meta charset="UTF-8">
5757
<title>Log Viewer</title>
5858
<script type="text/javascript">
59-
// Ensure client_ip is replaced by Scala string interpolation
60-
const client_ip = "$ip"; // This will be interpolated by Scala
59+
const client_ip = "$ip";
6160
const ws_protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
6261
const ws_host = window.location.host;
6362
const socket = new WebSocket(`$${ws_protocol}//$${ws_host}/api_ws?ip=$${client_ip}`);
@@ -82,7 +81,7 @@ class LogWebViewer(certPath: Option[String])(using system: ActorSystem) {
8281
socket.onclose = function(event) {
8382
intervalId && clearInterval(intervalId);
8483
delete intervalId;
85-
console.log("WebSocket connection closed");
84+
console.log("WebSocket connection closed, please reload browser to reconnect.");
8685
};
8786
</script>
8887
</head>

0 commit comments

Comments
 (0)