-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
libdatachannel
C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
// C++ Native Messaging host // https://browserext.github.io/native-messaging/ // https://developer.chrome.com/docs/apps/nativeMessaging/ // https://discourse.mozilla.org/t/webextension-with-native-messaging-c-app-side/30821 // https://github.com/nlohmann/json \#include \#include "json.hpp" using namespace std; using namespace nlohmann; struct message\_t { string content; uint32\_t length; }; // Read a message from stdin and decode it. json get\_message() { char raw\_length\[4\]; fread(raw\_length, 4, sizeof(char), stdin); uint32\_t message\_length = \*reinterpret\_cast(raw\_length); if (!message\_length) {
I found WebExtension with Native messaging C++ App side where the C++ design is similar to the Python design in Fix native message examples with python3 #157 that I have been using capture_system_audio.py.
// C++ Native Messaging host // https://browserext.github.io/native-messaging/ // https://developer.chrome.com/docs/apps/nativeMessaging/ // https://discourse.mozilla.org/t/webextension-with-native-messaging-c-app-side/30821 // https://github.com/nlohmann/json \#include \#include "json.hpp" using namespace std; using namespace nlohmann; struct message\_t { string content; uint32\_t length; }; // Read a message from stdin and decode it. json get\_message() { char raw\_length\[4\]; fread(raw\_length, 4, sizeof(char), stdin); uint32\_t message\_length = \*reinterpret\_cast(raw\_length); if (!message\_length) {
I found WebExtension with Native messaging C++ App side where the C++ design is similar to the Python design in Fix native message examples with python3 #157 that I have been using capture_system_audio.py.
exit(EXIT_SUCCESS); } char message[message_length]; fread(message, message_length, sizeof(char), stdin); string m(message, message + sizeof message / sizeof message[0]); return json::parse(m); } // Encode a message for transmission, given its content. message_t encode_message(json content) { string encoded_content = content.dump(); message_t m; m.content = encoded_content; m.length = (uint32_t)encoded_content.length(); return m; } // Send an encoded message to stdout. void send_message(message_t encoded_message) { char *raw_length = reinterpret_cast(&encoded_message.length); fwrite(raw_length, 4, sizeof(char), stdout); fwrite(encoded_message.content.c_str(), encoded_message.length, sizeof(char), stdout); fflush(stdout); } int main(int argc, char *argv[]) { while (true) { json message = get_message(); auto command = message.get(); // https://github.com/paullouisageneau/libdatachannel/issues/544#issuecomment-1024739214 // https://www.reddit.com/r/cpp\_questions/comments/swr1tk/comment/hxral9f/ FILE *pipe = popen(command.c_str(), "r"); while (true) { size_t bufferSize = 1024; byte buffer[bufferSize]; size_t count; while ((count = fread(buffer, 1, bufferSize, pipe)) > 0) { stringstream data; // S16NE PCM from parec to integers in JSON array data << "["; for (size_t i = 0; i < count; i++) { data << (int)buffer[i]; if (i < count - 1) { data << ","; } } data << "]"; // send JSON array to Native Messaging local client send_message(encode_message(data.str())); } } } }