From e45bbabef764b257f823c5cb997b2b8d952c8e4c Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Tue, 3 Mar 2020 10:11:14 +0200
Subject: [PATCH] Allow websock connections also

---
 applications/gui/src/src_window.cpp   | 2 +-
 applications/reconstruct/src/main.cpp | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/applications/gui/src/src_window.cpp b/applications/gui/src/src_window.cpp
index b829b76dc..105a37d54 100644
--- a/applications/gui/src/src_window.cpp
+++ b/applications/gui/src/src_window.cpp
@@ -157,7 +157,7 @@ SourceWindow::SourceWindow(ftl::gui::Screen *screen)
 			uri.to_json(screen->root()->getConfig()["sources"].emplace_back());
 		} else {
 			ftl::URI uri(path);
-			if (uri.getScheme() == ftl::URI::SCHEME_TCP) {
+			if (uri.getScheme() == ftl::URI::SCHEME_TCP || uri.getScheme() == ftl::URI::SCHEME_WS) {
 				screen->net()->connect(path);
 			}
 		}
diff --git a/applications/reconstruct/src/main.cpp b/applications/reconstruct/src/main.cpp
index 3e35b5ad9..c713a56a8 100644
--- a/applications/reconstruct/src/main.cpp
+++ b/applications/reconstruct/src/main.cpp
@@ -191,6 +191,11 @@ static void run(ftl::Configurable *root) {
 				sender->post(fs);
 				return true;
 			});
+		} else {
+			ftl::URI uri(path);
+			if (uri.getScheme() == ftl::URI::SCHEME_TCP || uri.getScheme() == ftl::URI::SCHEME_WS) {
+				net->connect(path)->waitConnection();
+			}
 		}
 	}
 
-- 
GitLab