upnp_client 1.4.1
upnp_client: ^1.4.1 copied to clipboard
Universal Plug and Play (UPnP) Client Implementation. Supports IGD control as well as DLNA media casting.
UPnP Client #
Universal Plug and Play (UPnP) Client Implementation. Supports IGD control as well as DLNA media casting.
Covered
- Discovery — SSDP search over IPv4 and IPv6, returning typed device profiles
- DLNA casting —
AVTransportplayback,RenderingControlvolume and mute,ConnectionManagerformat negotiation, and DIDL-Lite metadata - IGD port forwarding — NAT port mapping on
WANIPConnection/WANPPPConnection, plus external IP and WAN connection status
Not covered — eventing (GENA SUBSCRIBE/NOTIFY), ContentDirectory
browsing, and IPv6 pinholes. Services without a typed wrapper are still
reachable through Service.invokeAction.
Installation #
Use the package manager pub to install the upnp client.
dart pub add upnp_client
Usage #
See example/example.md for discovery, port forwarding and media casting, or run one of the examples against your own network:
dart run example/upnp_client_example.dart # discover everything
dart run example/port_forward_example.dart 8080 # map a port on the router
dart run example/media_cast_example.dart <http url> # cast audio to a renderer
To use on an Android device #
You must add the following permissions in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" android.usesPermissionFlags="neverForLocation"/>
To use on an iOS device (Required for iOS 14+) #
You need to follow these steps to use Multicast Networking functionalities on any iOS device:
- Go to https://developer.apple.com/contact/request/networking-multicast and fill out the form for your app.
- Wait for the acceptance email (Approx. 30 days).
- Go to https://developer.apple.com/account/resources/identifiers/list.
- Choose the needed app.
- Go to "Additional Capabilities".
- Mark "Multicast Networking".
- Go to your project file "Runner.xcworkspace".
- Choose "Runner" -> "Signing & Capabilities" -> "+ capability" and search for "Multicast Networking".
- Build your project.
Contributing #
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.