Skip to content

Commit 4dbafcc

Browse files
Simplify watch WebSocket URL: always use ws:// since watch never serves HTTPS
fsdocs watch binds to HTTP only (no SSL certs), so window.location.protocol can never be 'https:'. The wss: branch was dead code. Simplify to a direct ws:// URI using window.location.host. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c0698cd commit 4dbafcc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/fsdocs-tool/BuildCommand.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,7 @@ module Serve =
822822
let generateWatchScript () =
823823
"""
824824
<script type="text/javascript">
825-
var wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
826-
var wsUri = wsProtocol + "//" + window.location.host + "/websocket";
825+
var wsUri = "ws://" + window.location.host + "/websocket";
827826
function init()
828827
{
829828
websocket = new WebSocket(wsUri);

0 commit comments

Comments
 (0)