File: quickstart.rst

package info (click to toggle)
python-ssdpy 0.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 272 kB
  • sloc: python: 844; makefile: 29
file content (63 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
==========
Quickstart
==========

Run SSDP discovery from shell
=============================


.. note:: SSDP works by sending and receiving multicasts. This sometimes requires
          elevated permissions. If you get an error trying to use these commands, try
          running them as ``root`` (for example, using ``sudo``).

Discover services using SSDP
----------------------------
Searching for the special service type ``ssdp:all`` should return answers from all
active services.

.. code-block:: sh

    $ ssdpy-discover ssdp:all

Discover a specific type of service
-----------------------------------

Specify a different service type to only get responses from relevant services. For
example, if we want to find all `DIAL`_ services (e.g. Chromecast devices):

.. code-block:: sh

    $ ssdpy-discover urn:dial-multiscreen-org:service:dial:1

.. _DIAL: http://www.dial-multiscreen.org/


Run SSDP Server from shell
==========================

.. code-block:: sh

    $ ssdpy-server my-special-service --location 'http://10.0.0.1:8080/hello'



SSDP Discovery from Python
==========================

:class:`ssdpy.SSDPClient`

.. code-block:: python

    from ssdpy import SSDPClient
    client = SSDPClient()

SSDP Server from Python
=======================

:class:`ssdpy.SSDPServer`

.. code-block:: python

    from ssdpy import SSDPServer
    server = SSDPServer("my-special-service", location="http://192.168.0.100:8080/hello")
    server.server_forever()