Webブラウザを介して/org/freedesktop/DBusにアクセスできますか?

Webブラウザを介して/org/freedesktop/DBusにアクセスできますか?

Xubuntu 18.04オペレーティングシステムで実行されているいくつかのホームクラスアプリケーションがあり、D-Busを使用して互いに通信します。 UI部分はWebブラウザで実行され、Webソケットはアプリケーションと通信するために使用されます。

目標はすべての通信をD-Busに移行することですが、/org/freedesktop/DBusテストのためにChromeブラウザからアクセスしようとしましたが、成功しませんでした。使ったこの図書館:

var dbus = require('dbus-native')
  var conn = dbus.createConnection()
  conn.message({
    path: '/org/freedesktop/DBus',
    destination: 'org.freedesktop.DBus',
    'interface': 'org.freedesktop.DBus',
    member: 'Hello',
    type: dbus.messageType.methodCall
  })
  conn.on('message', function (msg) { console.log(msg) })

ブラウザコンソールに表示される内容は次のとおりです。

Uncaught Error: unknown bus address
    at createStream (index.js?26d9:22)
    at Object.createConnection (index.js?26d9:76)

これが私がそれを実行したときに見るものですdbus-monitor。しかし、それが私の接続の試みに関連しているかどうかはわかりません。

signal time=1626258028.185483 sender=org.freedesktop.DBus -> destination=:1.196 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.196"
signal time=1626258028.185641 sender=org.freedesktop.DBus -> destination=:1.196 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.196"
method call time=1626258031.724118 sender=:1.195 -> destination=org.freedesktop.PowerManagement serial=7 path=/org/freedesktop/PowerManagement/Inhibit; interface=org.freedesktop.PowerManagement.Inhibit; member=UnInhibit
   uint32 39
method return time=1626258031.724440 sender=:1.27 -> destination=:1.195 serial=151 reply_serial=7
method call time=1626258031.724721 sender=:1.195 -> destination=org.freedesktop.DBus serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal', path='/org/freedesktop/DBus/Local',interface='org.freedesktop.DBus.Local', member='Disconnected'"
method return time=1626258031.724743 sender=org.freedesktop.DBus -> destination=:1.195 serial=7 reply_serial=8
signal time=1626258031.725311 sender=org.freedesktop.DBus -> destination=:1.195 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.195"
signal time=1626258031.725517 sender=org.freedesktop.DBus -> destination=(null destination) serial=339 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.195"
   string ":1.195"
   string ""

Webブラウザを介してfreedesktop DBusにアクセスできますか?それともこれを許可するには、DBusデーモン構成をいくつか調整する必要がありますか?私はD-Busに初めて触れました。

ベストアンサー1

おすすめ記事