freedomjs / freedom-for-firefox

freedom.js for firefox add-ons
http://freedomjs.org
Apache License 2.0
6 stars 2 forks source link

UDP sockets don't bind to the right interface #67

Open bemasc opened 9 years ago

bemasc commented 9 years ago

The freedom UDP socket API allows the caller to bind to a particular interface, identified by its IP address. Unfortunately, the Firefox implementation ignores this and effectively just binds to 0.0.0.0.

trevj commented 9 years ago

Some more info...

Here's the call to bind the socket: https://github.com/freedomjs/freedom-for-firefox/blob/master/providers/core.udpsocket.js#L13

We should be able to use initWithAddress to specify a particular interface, although I wasn't able to quickly figure out how to pass a NetAddr argument:

bemasc commented 9 years ago

Unfortunately, initWithAddress is marked [noscript], so we can't use it from JS. The best option I could see for now is to set the aLoopbackOnly argument to true if the user asks to bind to localhost.

I filed a mozilla bug to complain about this: https://bugzilla.mozilla.org/show_bug.cgi?id=1178427

trevj commented 9 years ago

That's unfortunate but thanks for following up on this!

Does this affect our ability to run holographic ICE on Firefox?

bemasc commented 9 years ago

I suspect this will prevent us from doing IPv6 in Firefox. That's the only major issue I foresee.