From e9e94ef3cc1836c88f263e272eaff5b693741a8f Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 24 Jul 2022 13:16:18 +0200 Subject: [PATCH] Base: Launch WebSocket at session start-up --- Base/etc/SystemServer.ini | 10 ---------- Base/home/anon/.config/SystemServer.ini | 9 +++++++++ Userland/Libraries/LibProtocol/WebSocketClient.h | 2 +- Userland/Services/WebContent/main.cpp | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Base/etc/SystemServer.ini b/Base/etc/SystemServer.ini index 5f0afb4707..07d1e6adfd 100644 --- a/Base/etc/SystemServer.ini +++ b/Base/etc/SystemServer.ini @@ -17,16 +17,6 @@ SystemModes=graphical MultiInstance=true AcceptSocketConnections=true -[WebSocket] -Socket=/tmp/portal/websocket -SocketPermissions=600 -Lazy=true -Priority=low -User=anon -SystemModes=text,graphical -MultiInstance=true -AcceptSocketConnections=true - [NetworkServer] User=root SystemModes=text,graphical,self-test diff --git a/Base/home/anon/.config/SystemServer.ini b/Base/home/anon/.config/SystemServer.ini index abab78ce31..d08653245a 100644 --- a/Base/home/anon/.config/SystemServer.ini +++ b/Base/home/anon/.config/SystemServer.ini @@ -19,6 +19,15 @@ SystemModes=graphical MultiInstance=true AcceptSocketConnections=true +[WebSocket] +Socket=/tmp/user/%uid/portal/websocket +SocketPermissions=600 +Lazy=true +Priority=low +SystemModes=text,graphical +MultiInstance=true +AcceptSocketConnections=true + [LaunchServer] Socket=/tmp/user/%uid/portal/launch SocketPermissions=600 diff --git a/Userland/Libraries/LibProtocol/WebSocketClient.h b/Userland/Libraries/LibProtocol/WebSocketClient.h index 6d6d479f13..9edc484d38 100644 --- a/Userland/Libraries/LibProtocol/WebSocketClient.h +++ b/Userland/Libraries/LibProtocol/WebSocketClient.h @@ -18,7 +18,7 @@ class WebSocket; class WebSocketClient final : public IPC::ConnectionToServer , public WebSocketClientEndpoint { - IPC_CLIENT_CONNECTION(WebSocketClient, "/tmp/portal/websocket"sv) + IPC_CLIENT_CONNECTION(WebSocketClient, "/tmp/user/%uid/portal/websocket"sv) public: RefPtr connect(const URL&, String const& origin = {}, Vector const& protocols = {}, Vector const& extensions = {}, HashMap const& request_headers = {}); diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index 300002d33b..0db20b9016 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -25,7 +25,7 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil("/tmp/user/%uid/portal/request", "rw")); TRY(Core::System::unveil("/tmp/portal/image", "rw")); - TRY(Core::System::unveil("/tmp/portal/websocket", "rw")); + TRY(Core::System::unveil("/tmp/user/%uid/portal/websocket", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); Web::ImageDecoding::Decoder::initialize(WebView::ImageDecoderClientAdapter::create());