Is UDP Broadcast possible in a Chrome App

1,114 views
Skip to first unread message

Simon

unread,
Mar 12, 2015, 9:46:02 AM3/12/15
to chromi...@chromium.org
Hi,
i'm trying to send a simple udp packet to the broadcast (255.255.255.255) address inside of a Chrome app. I'm able to send udp packet to a regular address(10.22.172.5), but as soon as i try a broadcast address I get "Unchecked runtime.lastError while running sockets.udp.send: net::ERR_ACCESS_DENIED". After searching for a solution it seems that broadcast is not possible with the standard chrome.sockets.udp API. Then  i tried it with the Native Client. I wrote c code and compiled it with the nacl sdk. At the end i got the same result as before. It works for regular address(10.22.172.5) but not for broadcast. Now to my question: Is it in principle possible to send a udp packet to a broadcast adress inside of a Chrome app?

Reilly Grant

unread,
Mar 12, 2015, 1:57:05 PM3/12/15
to Simon, chromi...@chromium.org
Can you provide a minimal test application that demonstrates this failure? I need to see your application manifest and JavaScript.

On Thu, Mar 12, 2015 at 6:46 AM Simon <seidel....@googlemail.com> wrote:
Hi,
i'm trying to send a simple udp packet to the broadcast (255.255.255.255) address inside of a Chrome app. I'm able to send udp packet to a regular address(10.22.172.5), but as soon as i try a broadcast address I get "Unchecked runtime.lastError while running sockets.udp.send: net::ERR_ACCESS_DENIED". After searching for a solution it seems that broadcast is not possible with the standard chrome.sockets.udp API. Then  i tried it with the Native Client. I wrote c code and compiled it with the nacl sdk. At the end i got the same result as before. It works for regular address(10.22.172.5) but not for broadcast. Now to my question: Is it in principle possible to send a udp packet to a broadcast adress inside of a Chrome app?

--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Simon

unread,
Mar 14, 2015, 8:22:34 AM3/14/15
to chromi...@chromium.org, seidel....@googlemail.com
Here you have my background.js and my manifest.json file. Thanks for your help
background.js
manifest.json

jdz

unread,
Mar 26, 2015, 2:20:34 PM3/26/15
to chromi...@chromium.org, seidel....@googlemail.com
I have exactly the same issue. Does anyone know if it is even possible to do a broadcast from a chrome app?

Reilly Grant

unread,
Mar 27, 2015, 5:52:06 PM3/27/15
to jdz, chromi...@chromium.org, seidel....@googlemail.com
Chrome currently does not open broadcast-capable sockets (SO_BROADCAST is not set when the socket is created). I will look into whether or not it will be possible to enable this.

On Thu, Mar 26, 2015 at 11:20 AM jdz <dzth...@gmail.com> wrote:
I have exactly the same issue. Does anyone know if it is even possible to do a broadcast from a chrome app?

--

Joseph Dziezanowski

unread,
Mar 27, 2015, 6:00:16 PM3/27/15
to Reilly Grant, chromi...@chromium.org, seidel....@googlemail.com
Thanks for the reply. Our application requires broadcast to discover our embedded devices on a network. We had been planning all along to use a chrome app to do the discovery - it never occurred to us that this might not work. Any definitive info would be much appreciated. 

Sent from my iPad

Reilly Grant

unread,
Mar 27, 2015, 6:31:26 PM3/27/15
to Joseph Dziezanowski, chromi...@chromium.org, seidel....@googlemail.com

Shih Sheen

unread,
Jun 30, 2015, 1:54:57 AM6/30/15
to chromi...@chromium.org
Hi,
I've got the same issue on my chromebook with my packaged app.
The API works fine on my Windows desktop.
How to make it work on chromebook?

Simon於 2015年3月12日星期四 UTC+8下午9時46分02秒寫道:

Reilly Grant

unread,
Jun 30, 2015, 12:00:16 PM6/30/15
to Shih Sheen, chromi...@chromium.org

What version of Chrome OS are you running?


--

Shih Sheen

unread,
Jun 30, 2015, 10:07:24 PM6/30/15
to chromi...@chromium.org, cam....@gmail.com
Hi,
OS version is 43.0.2357.130
Platform 6946.63.0

I found that I can call udp.send  to 239.255.255.250 after udp.joinGroup to 239.255.255.250.(SSDP)

(Set "udp":{"bind":"*", "send":"*", "joinGroup":"*", "multicastMembership":""} in manifest)

But I still got "ERR_ACCESS_DENIED" while I'm trying to send message with udp.send to a normal IP address who response my SSDP multicast.

It's OK on Windows that just do udp.send to a IP address without joinGroup

Reilly Grant於 2015年7月1日星期三 UTC+8上午12時00分16秒寫道:
Reply all
Reply to author
Forward
0 new messages