问题
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:
- Press Ctrl+Alt+T to bring up a terminal window and type the following
- shell
- 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