[TV 2.5] Expose remote control service via mDNS

RESOLVED DUPLICATE of bug 1197749

Status

RESOLVED DUPLICATE of bug 1197749
3 years ago
3 years ago

People

(Reporter: lchang, Assigned: etsai)

Tracking

unspecified
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.6+)

Details

(Whiteboard: [ft:conndevices])

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
To provide a seamless experience, we would like to expose remote control service via mDNS.

Updated

3 years ago
Blocks: 1146810

Updated

3 years ago
Whiteboard: [ft:conndevices]

Updated

3 years ago
Blocks: 1187806
No longer blocks: 1146810
Whiteboard: [ft:conndevices] → [ft:conndevices][partner-blocker][partner-cherry-pick]

Updated

3 years ago
feature-b2g: --- → 2.5+
We can use |nsIDNSServiceDiscovery.registerService()|[1] to broadcast the control page via mDNS. DNS-SD already defined a "http" service type for it [2].

Here is the pseudo code for it.

let serviceInfo = Cc["@mozilla.org/toolkit/components/mdnsresponder/dns-info;1"].createInstance(Ci.nsIDNSServiceInfo);

serviceInfo.serviceType = "_http._tcp";
serviceInfo.serviceName = Services.prefs.getCharPref("dom.presentation.device.name");
serviceInfo.port = ... //the port number of http server

let attributes = Cc["@mozilla.org/hash-property-bag;1"].createInstance(Ci.nsIWritablePropertyBag2);
attributes.setPropertyAsACString("path", "/index.html");
serviceInfo.attributes = attributes;

let mdns = Cc["@mozilla.org/toolkit/components/mdnsresponder/dns-sd;1"].getService(Ci.nsIDNSServiceDiscovery);

mdns.registerService(serviceInfo, some_listener);


[1] https://dxr.mozilla.org/mozilla-central/source/netwerk/dns/mdns/nsIDNSServiceDiscovery.idl#201
[2] http://www.dns-sd.org/txtrecords.html#http
It's seems that we don't expose |attributes| to fennec now[1].

[1] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/mdns/MulticastDNSManager.java#197
See Also: → bug 1228192
Created attachment 8692819 [details] [diff] [review]
0001-Bug-1222306-Expose-remote-control-service-via-mDNS.patch

Updated

3 years ago
feature-b2g: 2.5+ → 2.6+

Updated

3 years ago
blocking-b2g: --- → 2.6?
feature-b2g: 2.6+ → ---
Whiteboard: [ft:conndevices][partner-blocker][partner-cherry-pick] → [ft:conndevices][partner-blocker]

Updated

3 years ago
blocking-b2g: 2.6? → 2.6+
Whiteboard: [ft:conndevices][partner-blocker] → [ft:conndevices]

Updated

3 years ago
Assignee: nobody → etsai
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Depends on: 1197749
Resolution: --- → DUPLICATE
Duplicate of bug: 1197749
You need to log in before you can comment on or make changes to this bug.