Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is TCPSocket available in WebRT

28 views
Skip to first unread message

Jovan Gerodetti

unread,
Sep 8, 2015, 12:57:49 PM9/8/15
to dev-w...@lists.mozilla.org, web...@lists.mozilla.org
Hey everyone,

Quick question.
Is the TCPSocket also available in the WebRT for Desktop Apps or is it FxOS
only?

Regards,
Jovan

Andrew Sutherland

unread,
Sep 8, 2015, 1:19:28 PM9/8/15
to dev-w...@lists.mozilla.org
Preference-wise, mozTCPSocket is available in WebRT. It requires the
"tcp-socket" permission is granted to the origin in question (or the
origin have the system principal). It is not available in desktop
Firefox without flipping a pref, "dom.mozTCPSocket.enabled". (WebRT
flips the pref by default.) See
https://bugzilla.mozilla.org/show_bug.cgi?id=1079648 for some more
details re: the preference.

In order to have the permission granted, the app needs to be a packaged
app in the firefox marketplace. There's no way to use WebIDE to
"side-load" to accomplish this. See
https://bugzilla.mozilla.org/show_bug.cgi?id=1038533

However, https://github.com/mykmelez/tcpsocketpup can be used to grant
the permission to any origin for development. This will flip the
"dom.mozTCPSocket.enabled" preference to true as well.

As one might surmise from all of this, I don't think it's a particularly
supported set of functionality for desktop at this time. TCPSocket is
no longer on a standardization track, and based on recent discussions,
may be headed for being an "add-on" API. See Jonas's sensitive API
thread here:
https://groups.google.com/d/msg/mozilla.dev.b2g/UB1CFnVy0mc/EQjRDt_YfZoJ

And the TCPSocket-specific sub-thread I reaised:
https://groups.google.com/d/msg/mozilla.dev.b2g/67KvfP0ZETk/UhZmm9APALcJ

The summary is probably that:
- TCPSocket is a known useful API
- It's still particularly dangerous and hard to explain that danger to
users which means it is likely to be gated by some type of human-review
for the default installation experience.

Andrew
> _______________________________________________
> dev-webapps mailing list
> dev-w...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-webapps

Jovan Gerodetti

unread,
Sep 8, 2015, 1:29:27 PM9/8/15
to Andrew Sutherland, dev-w...@lists.mozilla.org
Thank you Andrew!

We are currently trying to make Loqui IM also available on Desktop clients
so I was wondering if we'd be able still support all of our providers, also
thous we are connecting to with a mozTCPSocket.

Andrew Sutherland

unread,
Sep 8, 2015, 1:33:23 PM9/8/15
to Jovan Gerodetti, dev-w...@lists.mozilla.org
Then I think it should work!  (Noting that for development/debugging you
may want/need to use the extension to help out.)

Andrew
0 new messages