Chrome Sockets API Behaves Differently on Chrome OS (vs. Ubuntu, Windows)?

假装没事ソ 提交于 2019-12-10 20:04:36

问题


I have a sample Chrome packaged app which uses the Chrome sockets API to perform DNS service discovery. The heavy lifting is borrowed from the example here:

https://github.com/GoogleChrome/chrome-app-samples/tree/master/mdns-browser

I just use service names such as _pdl-datastream._tcp.local (instead of the default of _services._dns-sd._udp.local).

On both my Ubuntu and Windows setups (Chrome 25.0.1364.172), the app can successfully find my network printer; I can list its IP address and service instance name. However, it fails in Chrome OS on my Samsung Chromebook (Chrome 25.0.1364.173); nothing is found.

Any idea what the problem might be? Is this a known issue?


回答1:


You should check if it's the default firewall. On a Chromebook by default I believe all incoming connections are blocked. If you're running in dev mode you can do the following to allow all incoming udp traffic to test whether this is the problem:

  1. Press Ctrl+Alt+T to bring up a terminal window and type the following
  2. shell
  3. sudo iptables -I INPUT -p udp -j ACCEPT



回答2:


Yes, Chromebooks default to a restrictive firewall. However, if the incoming packet matches an outgoing one, the incoming packet should be permitted. Here's the list of firewall rules.




回答3:


According to the bug report created by Haw-Bin, this is verified as fixed since end of 2013.



来源:https://stackoverflow.com/questions/15555657/chrome-sockets-api-behaves-differently-on-chrome-os-vs-ubuntu-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!