diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-03-16 17:02:14 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-05-12 15:09:13 +0200 |
commit | 3097c2da963fe355c81816a74824170b6dce697c (patch) | |
tree | 8d2812233f4e1041b8bf984f04a438ce811c8f90 /platform/javascript/os_javascript.cpp | |
parent | d79e28c3021a4410f41a3bbff111d56b28f155ef (diff) | |
download | redot-engine-3097c2da963fe355c81816a74824170b6dce697c.tar.gz |
Add WebSocket debugger, use it for Javascript.
Diffstat (limited to 'platform/javascript/os_javascript.cpp')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 205644ce51..1ec23973d6 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -30,13 +30,19 @@ #include "os_javascript.h" +#include "core/debugger/engine_debugger.h" #include "core/io/file_access_buffered_fa.h" #include "core/io/json.h" #include "drivers/unix/dir_access_unix.h" #include "drivers/unix/file_access_unix.h" #include "main/main.h" +#include "modules/modules_enabled.gen.h" #include "platform/javascript/display_server_javascript.h" +#ifdef MODULE_WEBSOCKET_ENABLED +#include "modules/websocket/remote_debugger_peer_websocket.h" +#endif + #include <emscripten.h> #include <stdlib.h> @@ -68,6 +74,11 @@ void OS_JavaScript::initialize() { FileAccess::make_default<FileAccessBufferedFA<FileAccessUnix>>(FileAccess::ACCESS_RESOURCES); DisplayServerJavaScript::register_javascript_driver(); +#ifdef MODULE_WEBSOCKET_ENABLED + EngineDebugger::register_uri_handler("ws://", RemoteDebuggerPeerWebSocket::create); + EngineDebugger::register_uri_handler("wss://", RemoteDebuggerPeerWebSocket::create); +#endif + char locale_ptr[16]; /* clang-format off */ EM_ASM({ |