
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
airdcpp-apisocket
Advanced tools
JavaScript connector for AirDC++ Web API for Node.js and web browsers.
When communicating with the API locally, it's recommended to write an extension that is managed by the application itself instead of using this library directly. See the airdcpp-create-extension starter project for more information.
The example displays a status message in main chat every time a new user joins a hub.
const API = require('airdcpp-apisocket');
const w3cwebsocket = require('websocket').w3cwebsocket;
const settings = {
url: 'ws://localhost:5600/api/v1/',
username: 'exampleuser',
password: 'examplepass'
};
const socket = API.Socket(settings, w3cwebsocket);
const onUserConnected = function(user) {
// Show a status message in that particular hub
socket.post('hubs/status_message', {
hub_urls: [ user.hub_url ],
text: user.nick + ' joined the hub',
severity: 'info'
});
};
socket.onConnected = function() {
socket.addListener('hubs', 'hub_user_connected', onUserConnected);
};
socket.connect();
Please post any bugs or questions you may have on the issue tracker.
You must have Node.js installed for using the API connector.
If you are going to use the connector in browser environment, see AirDC++ Web UI for example usage.
Add the connector as dependency to an existing Node project by running
npm install airdcpp-apisocket --save
If you are unfamiliar with writing code for Node.js, you can check out this beginners tutorial.
The client is recommended to be used with ADC hubsofts as all API calls (or some of their options) can't be used with NMDC hubs.
Certain ADC hubsofts, such as Flexhub and Luadch don't follow the ADC protocol specs, which may cause unexplained issues when communicating with other clients.
Recommended hubsofts for development:
As many of the features require communicating with other clients, sometimes it's useful to check that the actual commands have been sent and those are received by the other party. Hubsofts (or their scripts) may block certain commands or impose rate limits for them.
If you are using AirDC++ Web Client, you can start the client with --cdm-client
and --cdm-hub
to display all protocol communication in the console. The Windows version has a separate CDM debug tab from where you can enable wanted message displaying options.
The ADC protocol specifications can be found from http://adc.sourceforge.net/ADC.html
FAQs
Javascript connector for AirDC++ Web API
The npm package airdcpp-apisocket receives a total of 93 weekly downloads. As such, airdcpp-apisocket popularity was classified as not popular.
We found that airdcpp-apisocket 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.