Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
@httptoolkit/dbus-native
Advanced tools
Part of HTTP Toolkit: powerful tools for building, testing & debugging HTTP(S)
Pure JS D-Bus protocol client & server for browsers and Node.js.
This is a fork of dbus-native, aiming to extend it for use in frida-js and HTTP Toolkit with:
npm install @httptoolkit/dbus-native
Short example using desktop notifications service
const dbus = require('@httptoolkit/dbus-native');
const sessionBus = dbus.sessionBus();
sessionBus.getService('org.freedesktop.Notifications').getInterface(
'/org/freedesktop/Notifications',
'org.freedesktop.Notifications', function(err, notifications) {
// dbus signals are EventEmitter events
notifications.on('ActionInvoked', function() {
console.log('ActionInvoked', arguments);
});
notifications.on('NotificationClosed', function() {
console.log('NotificationClosed', arguments);
});
notifications.Notify('exampl', 0, '', 'summary 3', 'new message text', ['xxx yyy', 'test2', 'test3', 'test4'], [], 5, function(err, id) {
//setTimeout(function() { n.CloseNotification(id, console.log); }, 4000);
});
});
connection = dbus.createClient(options)
options:
DBUS_SESSION_BUS_ADDRESS
environment variable. See http://dbus.freedesktop.org/doc/dbus-specification.html#addressesconnection has only one method, message(msg)
message fields:
connection signals:
example:
const dbus = require('@httptoolkit/dbus-native');
const 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); });
Long.js is used for 64 Bit support. https://github.com/dcodeIO/long.js The following javascript types can be marshalled into 64 bit dbus fields:
By default 64 bit dbus fields are unmarshalled into a 'number' (with precision loss beyond 53 bits). Use {ReturnLongjs:true} option to return the actual Long.js object and preserve the entire 64 bits.
FAQs
D-bus protocol implementation in native javascript
The npm package @httptoolkit/dbus-native receives a total of 22 weekly downloads. As such, @httptoolkit/dbus-native popularity was classified as not popular.
We found that @httptoolkit/dbus-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.