Reputation: 129
Is there a way to call an external program on client side and "talk" to it?
For example, if I have a Node.js serverving an AngularJS or any other framework, I want the user to press a button on the browser and a previously installed program on client-side starts to run and send back to the client some messages...
Can I achieve that?
Upvotes: 3
Views: 3797
Reputation: 2867
This is certainty possible in many different ways.
One sort is using node webkit.
Another,a NPM package called Edge. This is sort of like a bridge between node a .net. Or more specifically node and a clr process. You can execute c# statements and load assemblies in a clr process and interact with it in javascript via node and Edge.
https://github.com/tjanczuk/edge
Upvotes: 1
Reputation: 2767
Browsers cannot run executables on the local machine without explicit configuration as such behaviour would violate security restrictions.
Node.js can do anything that is permitted by the environment (e.g user permissions) in which it is run. See: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
Upvotes: 4
Reputation: 48948
Consider using Native Client
Native Client is a sandbox for running compiled C and C++ code in the browser efficiently and securely, independent of the user’s operating system. Portable Native Client extends that technology with architecture independence, letting developers compile their code once to run in any website and on any architecture with ahead-of-time (AOT) translation.
In short, Native Client brings the performance and low-level control of native code to modern web browsers, without sacrificing the security and portability of the web.
https://developer.chrome.com/native-client
Upvotes: 1