-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate using Native Messaging protocol for network (cloud) messaging #13
Comments
This is the Native messaging protocol
This is what a manifest looks like
We connect to the host using either
or sending (potentially receiving) a single message
There is also The message format is JSON, which is a format capable of sending and receiving essentially any type of serialized data in the format Each message is preceded by the length of the JSON message, in each direction. In the context of WASI messaging this is a very simple and extensible messaging protocol. We can connect to any host using the name of the host, e.g.,
Working example of above pattern https://github.com/guest271314/captureSystemAudio/tree/master/native_messaging/capture_system_audio. For the use case of getting lists of possible radio stations, or other fields of interest a single message to the host from the client and from the host to the client (or whtever terminology we want to use here, e.g., "peers") using the name of the service or peer who provides such a list of possible message channels or peers
We can use whatever underlying transport we want. HTTP/2, HTTP/3, QUIC, WebRTC, etc. Very simple to use. Nothing unnecessarily complicated about the protocol nor configuration. Achieves real-time audio streaming without gaps or glitches using JSON (or a JavaScript object). |
This is a Native Messaging host written in C https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_c.c (I also compiled a C++ version to WebAssembly), compiled to WASI using WASI-SDK that just echoes 1 MB of data. I have written Native Messaging hosts using Python, JavaScript (QuickJS; txiki.js; Bun; Node.js; Deno; Bash version is W.I.P.) https://github.com/guest271314/NativeMessagingHosts, in part to gain empirical information about the resources and dependencies, if any, each programming language or runtime uses to achieve the same result, and in another part, though the totoality of my reasoning, to not become attached to one programming language - though I write most of my code in JavaScript. |
@danbugs Some progress. Native Messaging protocol standalone test nm_standalone_test.js. You can compile to a standalone executable with
Then test the protocol on the commad-line outside of the browser using multiple programming languages, including Rust https://github.com/guest271314/NativeMessagingHosts/blob/main/nm_rust.rs, and WebAssembly. Some experiments with Bytecode Aliiance's Javy https://github.com/guest271314/native-messaging-webassembly/edit/main/README.md
which executes the host as a child process, communicating using the protocol
|
No description provided.
The text was updated successfully, but these errors were encountered: