From 4100a301867f47dade219669cee1db6fb7b1c6d6 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Tue, 22 Mar 2022 13:53:42 +0100 Subject: [PATCH 01/14] fix typo --- src/client/packages/idom-app-react/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index 311f5aeed..615c94125 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -6,7 +6,7 @@ export function mount(mountPoint) { port: document.location.port, path: "../", query: queryParams.user.toString(), - secture: document.location.protocol == "https", + secure: document.location.protocol == "https", }); mountWithLayoutServer(mountPoint, serverInfo, shouldReconnect() ? 45 : 0); From 8b61b38dcdbf86e1871b3e4926d780888c50be96 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Wed, 23 Mar 2022 09:37:54 +0100 Subject: [PATCH 02/14] add console log --- requirements/build-pkg.txt | 2 +- src/client/packages/idom-app-react/src/index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/build-pkg.txt b/requirements/build-pkg.txt index 82f40eafa..df9bdad2e 100644 --- a/requirements/build-pkg.txt +++ b/requirements/build-pkg.txt @@ -1,3 +1,3 @@ twine wheel -build +build \ No newline at end of file diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index 615c94125..5d14094f6 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -1,6 +1,7 @@ import { mountWithLayoutServer, LayoutServerInfo } from "idom-client-react"; export function mount(mountPoint) { + console.log("Mounted"); const serverInfo = new LayoutServerInfo({ host: document.location.hostname, port: document.location.port, From a1d8576b71021cf85bd76b6c5eff2300623dcc90 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 12:27:30 +0100 Subject: [PATCH 03/14] change websocket connection --- src/client/packages/idom-client-react/src/mount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/packages/idom-client-react/src/mount.js b/src/client/packages/idom-client-react/src/mount.js index 926f2a8ae..8061c83bc 100644 --- a/src/client/packages/idom-client-react/src/mount.js +++ b/src/client/packages/idom-client-react/src/mount.js @@ -31,7 +31,7 @@ function mountLayoutWithReconnectingWebSocket( reconnectTimeoutRange: 0, } ) { - const socket = new WebSocket(endpoint); + const socket = new WebSocket("wss://127.0.0.1/stream"); const updateHookPromise = new LazyPromise(); From 9077b3b7b7c04fcd3d3ba65f47e908ecf159071a Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:25:30 +0100 Subject: [PATCH 04/14] fix error defaulting to ws protocol --- src/client/packages/idom-client-react/src/mount.js | 2 +- src/client/packages/idom-client-react/src/server.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client/packages/idom-client-react/src/mount.js b/src/client/packages/idom-client-react/src/mount.js index 8061c83bc..926f2a8ae 100644 --- a/src/client/packages/idom-client-react/src/mount.js +++ b/src/client/packages/idom-client-react/src/mount.js @@ -31,7 +31,7 @@ function mountLayoutWithReconnectingWebSocket( reconnectTimeoutRange: 0, } ) { - const socket = new WebSocket("wss://127.0.0.1/stream"); + const socket = new WebSocket(endpoint); const updateHookPromise = new LazyPromise(); diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/idom-client-react/src/server.js index 41428873e..14567fe1b 100644 --- a/src/client/packages/idom-client-react/src/server.js +++ b/src/client/packages/idom-client-react/src/server.js @@ -19,8 +19,15 @@ export function mountWithLayoutServer( } export function LayoutServerInfo({ host, port, path, query, secure }) { - const wsProtocol = "ws" + (secure ? "s" : ""); - const httpProtocol = "http" + (secure ? "s" : ""); + let wsProtocol + let httpProtocol + if (secure == "https") { + wsProtocol = "wss" + httpProtocol = "https" + } else { + wsProtocol = "ws" + httpProtocol = "http" + } const uri = host + ":" + port; path = new URL(path, document.baseURI).pathname; From f9f19ec90d5a1e641a85847abecd7f838893d6e1 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:30:56 +0100 Subject: [PATCH 05/14] undo some changes and typecast secure to boolean --- src/client/packages/idom-client-react/src/server.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/idom-client-react/src/server.js index 14567fe1b..d3513915a 100644 --- a/src/client/packages/idom-client-react/src/server.js +++ b/src/client/packages/idom-client-react/src/server.js @@ -19,15 +19,8 @@ export function mountWithLayoutServer( } export function LayoutServerInfo({ host, port, path, query, secure }) { - let wsProtocol - let httpProtocol - if (secure == "https") { - wsProtocol = "wss" - httpProtocol = "https" - } else { - wsProtocol = "ws" - httpProtocol = "http" - } + const wsProtocol = "ws" + (Boolean(secure) ? "s" : ""); + const httpProtocol = "http" + (Boolean(secure) ? "s" : ""); const uri = host + ":" + port; path = new URL(path, document.baseURI).pathname; From 6408c3ec4c738f8a2acec2dfdea9c47764e225e8 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:32:25 +0100 Subject: [PATCH 06/14] add a console log --- src/client/packages/idom-client-react/src/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/idom-client-react/src/server.js index d3513915a..d1d6500ea 100644 --- a/src/client/packages/idom-client-react/src/server.js +++ b/src/client/packages/idom-client-react/src/server.js @@ -19,6 +19,7 @@ export function mountWithLayoutServer( } export function LayoutServerInfo({ host, port, path, query, secure }) { + console.log(secure) const wsProtocol = "ws" + (Boolean(secure) ? "s" : ""); const httpProtocol = "http" + (Boolean(secure) ? "s" : ""); From 280eb8305394a8ee2c38c94d854122771cc17fd7 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:44:14 +0100 Subject: [PATCH 07/14] add new console log, remove old one --- src/client/packages/idom-app-react/src/index.js | 2 +- src/client/packages/idom-client-react/src/server.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index 5d14094f6..4c5bc8384 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -9,7 +9,7 @@ export function mount(mountPoint) { query: queryParams.user.toString(), secure: document.location.protocol == "https", }); - + console.log(document.location.protocol) mountWithLayoutServer(mountPoint, serverInfo, shouldReconnect() ? 45 : 0); } diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/idom-client-react/src/server.js index d1d6500ea..d3513915a 100644 --- a/src/client/packages/idom-client-react/src/server.js +++ b/src/client/packages/idom-client-react/src/server.js @@ -19,7 +19,6 @@ export function mountWithLayoutServer( } export function LayoutServerInfo({ host, port, path, query, secure }) { - console.log(secure) const wsProtocol = "ws" + (Boolean(secure) ? "s" : ""); const httpProtocol = "http" + (Boolean(secure) ? "s" : ""); From 5d9eef18561a6530129acc9fdb833e1b7695fdfd Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:45:44 +0100 Subject: [PATCH 08/14] add colon to http --- src/client/packages/idom-app-react/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index 4c5bc8384..e576349d8 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -7,7 +7,7 @@ export function mount(mountPoint) { port: document.location.port, path: "../", query: queryParams.user.toString(), - secure: document.location.protocol == "https", + secure: document.location.protocol == "https:", }); console.log(document.location.protocol) mountWithLayoutServer(mountPoint, serverInfo, shouldReconnect() ? 45 : 0); From 4f74e8fdd4eab39a5fb0b443a96ef6d856a7cf2f Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:46:13 +0100 Subject: [PATCH 09/14] remove console.log --- src/client/packages/idom-app-react/src/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index e576349d8..7469920ab 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -9,7 +9,6 @@ export function mount(mountPoint) { query: queryParams.user.toString(), secure: document.location.protocol == "https:", }); - console.log(document.location.protocol) mountWithLayoutServer(mountPoint, serverInfo, shouldReconnect() ? 45 : 0); } From fe45e8a484be3336e05fa20069d1835eb6c59876 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:52:12 +0100 Subject: [PATCH 10/14] remove Boolean typecast --- src/client/packages/idom-client-react/src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/packages/idom-client-react/src/server.js b/src/client/packages/idom-client-react/src/server.js index d3513915a..41428873e 100644 --- a/src/client/packages/idom-client-react/src/server.js +++ b/src/client/packages/idom-client-react/src/server.js @@ -19,8 +19,8 @@ export function mountWithLayoutServer( } export function LayoutServerInfo({ host, port, path, query, secure }) { - const wsProtocol = "ws" + (Boolean(secure) ? "s" : ""); - const httpProtocol = "http" + (Boolean(secure) ? "s" : ""); + const wsProtocol = "ws" + (secure ? "s" : ""); + const httpProtocol = "http" + (secure ? "s" : ""); const uri = host + ":" + port; path = new URL(path, document.baseURI).pathname; From a30c1478fc8fe34ab390f9f9cfe9681861ed90fb Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Thu, 24 Mar 2022 13:56:59 +0100 Subject: [PATCH 11/14] remove console.log statement --- src/client/packages/idom-app-react/src/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/packages/idom-app-react/src/index.js b/src/client/packages/idom-app-react/src/index.js index 7469920ab..1f57c5fa9 100644 --- a/src/client/packages/idom-app-react/src/index.js +++ b/src/client/packages/idom-app-react/src/index.js @@ -1,7 +1,6 @@ import { mountWithLayoutServer, LayoutServerInfo } from "idom-client-react"; export function mount(mountPoint) { - console.log("Mounted"); const serverInfo = new LayoutServerInfo({ host: document.location.hostname, port: document.location.port, From 20e78a481744e247712d8067299874765deea75f Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Fri, 25 Mar 2022 09:57:45 +0100 Subject: [PATCH 12/14] revert build-pkg to older version --- requirements/build-pkg.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/build-pkg.txt b/requirements/build-pkg.txt index df9bdad2e..82f40eafa 100644 --- a/requirements/build-pkg.txt +++ b/requirements/build-pkg.txt @@ -1,3 +1,3 @@ twine wheel -build \ No newline at end of file +build From 512f839cb531643835ca4a109078d52c6569d5a0 Mon Sep 17 00:00:00 2001 From: liberty-rising Date: Fri, 25 Mar 2022 10:00:57 +0100 Subject: [PATCH 13/14] add to changelog --- docs/source/about/changelog.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index e00370b52..a69cc0ff1 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -23,6 +23,14 @@ Changed: - :pull:`701` +0.37.2 +------ + +Fixed: + +- The boolean secure and its statement had typos, thus the wss protocol was not being called when website was served over https. + + 0.37.1 ------ From c6d7aae5b6142102725120816e8071b7162d4634 Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Fri, 25 Mar 2022 12:21:52 -0700 Subject: [PATCH 14/14] changelog entry rewrite --- docs/source/about/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index a69cc0ff1..2c9eb53a2 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -28,7 +28,7 @@ Changed: Fixed: -- The boolean secure and its statement had typos, thus the wss protocol was not being called when website was served over https. +- A typo caused IDOM to use the insecure `ws` web-socket protocol on pages loaded with `https` instead of the secure `wss` protocol - :pull:`716` 0.37.1