这个演示使用了什么彗星技术?
他们在这个演示中所做的正是我想做的。
http://www.lightstreamer.com/demo/RoundTripDemo/
我想知道什么彗星技术他们正在使用。
它不能是 iframe,因为在 Firefox 上我可以打开两个具有相同链接的选项卡。使用 iframe 你不能这样做。而且它不能用ajax进行长时间轮询,因为我没有看到它用firebug轮询任何东西。
有人知道答案吗? (如果有一些好的教程的链接就太好了,这些教程用相同的技术做完全相同的事情)。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
虽然我现在不喜欢挖掘混淆的脚本,但从页面 DOM 的内容来看,它正在从隐藏的
Whilst digging through the obfuscated scripts is not something I fancy right now, judging by the contents of the page DOM it is posting data from a
<form>
inside a hidden<iframe>
to send data to the server, and having the server send back<script>
tags with code to pass data back to the caller.This is a rather heavyweight and obtrusive technique. It was the only way of doing in-page server communication in the days before
XMLHttpRequest
existed; I typically wouldn't use it today.(I wish WebSocket would hurry up and get implemented, doing away with all the long-polling nastiness.)
看起来像是 Lightstream 开发的几种技术,其中包括“香草”彗星。 Lightstreamer 白皮书 的简短摘录:
每个 Lightstreamer 客户端通常都会打开一个永久的联系
使用 Lightstreamer Server,在该服务器上推送与
任意数量的物品、框架和窗户通过
多路复用技术。
白皮书和演示非常有趣......
Looks like several techniques developed by Lightstream which include "vanilla" comet. A brief excerpt from the Lightstreamer white paper:
Each Lightstreamer client typically opens a single permanent connection
with Lightstreamer Server, on which the push updates relating to an
arbitrary number of items, frames and windows travel by means of
multiplexing techniques.
The white paper and demos are very interesting...
有一次我为 Lighttpd Web 服务器开发了一个模块。该模块实现了全双工 Ajax 技术,与 Comet 非常相似。在我的博客文章中,您将找到有关 FDAjax / Comet 的所有信息, JavaScript 示例、防火墙和防病毒程序问题等。Lighttpd
项目似乎已经死了。据我所知,流行的 nginx 有一个类似的 模块 。但将来我们将使用网络套接字。
顺便说一句,我使用了几个 HTTP 地址(www1.example.com、www2.example.com...)来解决浏览器对同一 Web 服务器最多两个 IP 并发连接的限制。 www[n] 实际上被解析为相同的 IP 地址。如果可能发生锁定,浏览器会自动重定向到下一个 www[n] 地址。
Once I developed a module for the Lighttpd web server. The module implemented a Full Duplex Ajax technique, very similar to Comet. In my blog posts you'll find everything you need about FDAjax / Comet, JavaScript examples, problems with firewalls and anti-virus programs, etc.
Lighttpd project seems to be dead. As far I know there is a similar module for the popular nginx. However in future we'll use web sockets.
BTW I used few HTTP addresses (www1.example.com, www2.example.com, ...) to work around the browsers limit of max two IP concurrent connections to the same web server. www[n] were in fact resolved to the same IP address. In case of possible lockup, a browser was automatically redirected to the next www[n] address.