npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

peer-dial-prompt

v0.2.0

Published

Nodejs implementation of the Discovery and Launch Protocol DIAL

Readme

peer-dial-prompt

A fork of peer-dial modified for testing DIAL app launch on Amazon Fire TV and Vega devices. This module implements the Discovery and Launch Protocol DIAL as described in the Protocol Specification Document.

Changes from original peer-dial

Hybrid device discovery (SSDP + network scan)

The test client uses a two-phase approach to find DIAL devices on the network:

  1. SSDP multicast discovery (5s) - finds devices advertising via standard DIAL protocol
  2. Subnet port scan - scans the local /24 subnet on common DIAL ports (60000, 8008, 8060) to find devices that have DIAL running but don't respond to SSDP

This hybrid approach was needed because Vega OS devices run dial-service (DIAL HTTP endpoints on port 60000 for device description, port 8009 for apps) but the SSDP multicast component does not respond to M-SEARCH requests on current builds.

Interactive device selection and app launch

After scanning, the client:

  1. Displays a table of all discovered DIAL devices (name, manufacturer, model, IP)
  2. Lets you select which device to target
  3. Prompts for the dial_id value (from the app's manifest.toml)
  4. Launches the app via DIAL and reports success/failure

Updated dependencies

All dependencies updated to latest versions. Deprecated packages replaced:

  • node-uuid replaced with uuid
  • opn replaced with open
  • Added prompt-sync for interactive input

Dependencies

  • Node.js
  • All other dependencies installed via npm install

Setup

npm install

Run Examples

DIAL Client (scan and launch)

node test/dial-client.js

The client will automatically scan your network and present a list of DIAL devices to choose from. Example output:

=== DIAL Device Scanner ===

[1/2] Running SSDP discovery (5s)...
[2/2] Scanning subnet 192.168.4.0/24 on ports 60000, 8008, 8060...

Found 2 DIAL device(s):

  #  | Name                     | Manufacturer | Model          | IP
  ---|--------------------------|--------------|----------------|----------------
    1 | Behyad Vega BH           | Amazon       | AFTCA002       | 192.168.4.195:60000
    2 | DIAL Demo Server         | Fraunhofer   | DIAL Demo      | 192.168.4.182:3000

Select device # (or 'q' to quit):

DIAL Server (for local testing)

node test/dial-server.js

Starts a DIAL server on port 3000 that advertises via SSDP and supports app launch.

Verifying DIAL on a device manually

# Check DIAL is running (look for port 60000)
adb shell netstat -tlnp

# Test device description endpoint
curl -v http://<DEVICE_IP>:60000/dd.xml

The response should include an Application-URL header pointing to the apps endpoint (typically http://<DEVICE_IP>:8009/apps/).

Known Issues

  • SSDP discovery not working on Vega OS - The dial-service on Vega devices does not respond to SSDP multicast M-SEARCH requests, even though the DIAL HTTP endpoints are functional. The subnet port scan works around this by connecting directly to known DIAL ports. Mobile companion apps that rely solely on SSDP will not discover these devices.

API

The peer-dial module contains implementation for DIAL Client and Server.

Server

var dial = require("peer-dial-prompt");
var http = require('http');
var express = require('express');
var app = express();
var server = http.createServer(app);

var dialServer = new dial.Server({
    expressApp: app,
    port: 3000,
    prefix: "/dial",
    corsAllowOrigins: "*",
    manufacturer: "My Company",
    modelName: "My Device",
    delegate: {
        getApp: function(appName) { /* return app object */ },
        launchApp: function(appName, launchData, callback) { /* launch logic */ },
        stopApp: function(appName, pid, callback) { /* stop logic */ }
    }
});

server.listen(3000, function() {
    dialServer.start();
});

CORS can be controlled via corsAllowOrigins (default: disabled). Set to true to allow all origins, or pass a string, regex, or function. See the cors package docs.

Client

var dial = require("peer-dial-prompt");
var dialClient = new dial.Client();

// Get device description
dialClient.getDialDevice("http://<IP>:60000/dd.xml", function(dialDevice, err) {
    // Get app info
    dialDevice.getAppInfo("myApp", function(appInfo, err) {
        // Launch app
        dialDevice.launchApp("myApp", "launchData", "text/plain", function(res, err) {
            console.log("Launched!");
        });
    });
});

License

Free for non commercial use released under the GNU Lesser General Public License v3.0. See LICENSE file.

Contact us for commercial use [email protected]

Copyright (c) 2015 Fraunhofer FOKUS