Chrome Sockets API在Chrome OS(与Ubuntu,Windows)上表现不同? [英] Chrome Sockets API Behaves Differently on Chrome OS (vs. Ubuntu, Windows)?

查看:158
本文介绍了Chrome Sockets API在Chrome OS(与Ubuntu,Windows)上表现不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Chrome套接字API执行DNS服务发现的Chrome打包应用示例。举例来自这里的示例:

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



我只是使用服务名称,如 _pdl-datastream._tcp.local (而不是默认的 _services._dns-sd._udp.local )。



在我的Ubuntu和Windows设置(Chrome 25.0.1364.172)上,该应用程序可以成功找到我的网络打印机;我可以列出它的IP地址和服务实例名称。但是,我的Samsung Chromebook(Chrome 25.0.1364.173)在Chrome操作系统中失败;没有发现任何东西。



任何想法可能是什么问题?这是一个已知的问题吗?

解决方案

您应该检查它是否是默认的防火墙。在Chromebook默认情况下,我认为所有传入的连接都被阻止。如果您在开发模式下运行,您可以执行以下操作,以允许所有传入的udp流量来测试这是否是问题:


  1. 按Ctrl + Alt + T打开一个终端窗口并输入以下内容:

  2. sudo iptables -I INPUT -p udp -j ACCEPT
  3. / li>


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?

解决方案

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

这篇关于Chrome Sockets API在Chrome OS(与Ubuntu,Windows)上表现不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆