Notifies a WebSocket connection about filesystem changes.
Relies on efsw for detecting filesystem changes in a cross-platform way, and Simple-WebSocket-Server for a WebSocket client.
Usage: <watch_dir> <websocket_host_port_path> watch_dir - directory to recursively watch for changes websocket_host_port_path - host, port and path of WebSocket server to write changes to. Example: ./src localhost:8080 Currently doesn't write to a secure WebSocket connection (i.e. wss://).
-
Install Conan - a free and open-source C/C++ package manager.
-
Create a default Conan profile:
conan profile detect --force -
conan install . --output-folder=build --build=missing
cd build
Linux, macOS:
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Releasecmake --build .
Windows (assuming Visual Studio 15 2017 is your VS version and that it matches your default profile):
cmake .. -G "Visual Studio 15 2017" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"cmake --build . --config Release
This should create a filesystem-websocket-notifier executable in build/.
See Also: https://docs.conan.io/2/tutorial/consuming_packages/build_simple_cmake_project.html
This project was successfully built with the following Conan profile:
$ conan profile detect --force ↵ detect_api: Found cc=gcc- 11.4.0 detect_api: gcc>=5, using the major as version detect_api: gcc C++ standard library: libstdc++11 Detected profile: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu17 compiler.libcxx=libstdc++11 compiler.version=11 os=Linux For testing purposes, a basic WebSocket server written in Node.js has been included.
-
Install Node.js.
-
Install dependencies:
npm install -
Start WebSocket server on port 8080:
npm start