Question

I want to use libvirt api from dart program. Here is the doc https://www.dartlang.org/articles/native-extensions-for-standalone-dart-vm/. But i find it's only usable in dart command line app, so is dart.io. I am not familiar with web app, i wonder why this is happening and why we can not invoke system API in a web app. Is it just impossible or there are other tricks to get that done?

Edit: If i really want to writ a web app which invoke libvirt c api in the system, what should i do? For the first one, i can write a backend server to supply api(REST maybe) to the web app. But what if i don't want to have a server backend, and is it possible to access libvirt api from a chrome extension. I saw chrome extension can run as background app, which i think may be not web app.

Was it helpful?

Solution

Web apps run in the browser and don't have access to the system directly which is what dart:io is about. This would be a serious security issue if arbitrary websites had access to your local file system/network/... . This is no Dart limitation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top