Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要为 Firefox 编写一个扩展,它接受来自套接字连接的数据并可以通过同一端口发送回复消息。我想知道是否有人知道任何教程或一些示例代码,因为我找不到很多 Firefox 4 指南。
为此,您可以在 javascript 中使用 mozilla.org 中的 nsIServerSocket 接口来创建套接字连接,并读入和打印出与该连接关联的流。
如果您使用的是 beta 8+,它可能会因为安全问题而被禁用。
看这里
如果您想要一个回退到 Flash 然后进行长轮询的套接字库,请查看Socket.IO