Giter Site home page Giter Site logo

nerves_ssdp_server's Introduction

Nerves.SSDPServer

Simple Server for the Simple Services Discovery Protocol

SSDP allows devices on LAN to announce themselves and their services to other devices.

Installation

If available in Hex, the package can be installed as:

  1. Add nerves_ssdp_server to your list of dependencies in mix.exs:

    def deps do [{:nerves_ssdp_server, "~> 0.2.2"}] end

  2. Ensure nerves_ssdp_server is started before your application:

    def application do [applications: [:nerves_ssdp_server]] end

Usage

In SSDP, every service needs to define a USN (unique service name), and a ST (service type). That's the minimum required to publish a service. With that info, it's as simple as this:

alias Nerves.SSDPServer

SSDPServer.publish "my_unique_service_name", "my-service-type"

Publishing custom fields

Other parameters you might specify for the second parameter to publish are included as fields of the published service. For instance, you can do..

alias Nerves.SSDPServer

@ssdp_fields [
    location: "http://localhost:3000/myservice.json",
    server: "MyServerName",
    "cache-control": "max-age=1800"
]

SSDPServer.publish "my-service-name", "my-service-type", @ssdp_fields

You can call publish to publish multiple services, each with a unique USN, but you can only publish each USN once, as per the SSDP spec.

The nerves-project-org:service:cell:1 service type

  • LOCATION if present, specifies a URL to grab a cell description

References

Here is are some links with background information about SSDP.

http://www.w3.org/TR/discovery-api/#simple-service-discovery-protocol-ssdp http://www.upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.0-20080424.pdf

nerves_ssdp_server's People

Contributors

ghitchens avatar sleeping-barber avatar danepod avatar julianpistorius avatar cyclamenpur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.