Gmail 如何在 Opera 上做彗星?

发布于 2024-08-29 13:21:10 字数 493 浏览 4 评论 0原文

我想知道 Gmail(或其他任何人)如何在 Opera 上实现彗星。

这是迄今为止我从实验中了解到的信息。

  1. 它不使用 Opera 中损坏的 event-source 标签10.51。
  2. 它不使用显示旋转的颤动器和忙碌的鼠标光标的 iframe。
  3. 当readyState = 3时,它不会在xmlhttprequest上使用responseText,已知这在Opera上会被破坏。

我尝试看看在 mibbit 和 etherpad 中是如何完成的,我发现它们都使用长轮询。

赏金

谁能告诉我一种比 Opera comet 流式传输的“事件源”更好的方法,或者 gmail 如何进行流式传输(或长轮询,如果它可以做到这一点),谁就能得到赏金。

I would like to know how Gmail (or anyone else) does comet on Opera.

Here is what I know so far from my experiments.

  1. It doesn't use the event-source tag which is broken in Opera 10.51.
  2. It doesn't use iframe which displays a spinning throbber and a busy mouse cursor.
  3. It doesn't use responseText on xmlhttprequest when readyState = 3 which is known to be broken on Opera.

I tried seeing how it was done in mibbit and etherpad, and I found that they both use long-polling.

Bounty

The bounty goes to whoever can tell me a method better than "event-source" for Opera comet streaming, or how gmail does streaming (or long-polling if it does that).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

私藏温柔 2024-09-05 13:21:11

GMail 使用 BrowserChannel(文档 | 来源),包含在 Google 的 闭包库

  • @fileoverview BrowserChannel 类的定义。浏览器通道
  • 模拟 HTTP 上的双向套接字。这是其基础
  • 与服务器的 Gmail 聊天 IM 连接。

GMail uses BrowserChannel (Docs | Source), which is included in Google's Closure Library.

  • @fileoverview Definition of the BrowserChannel class. A BrowserChannel
  • simulates a bidirectional socket over HTTP. It is the basis of the
  • Gmail Chat IM connections to the server.
多彩岁月 2024-09-05 13:21:11

我真的不知道答案是什么。但我知道 Opera 支持服务器事件: http://my.opera.com /WebApplications/blog/show.dml/438711 。也许这是迈向答案的一步?
我也不太确定,但我认为他们在 Opera Unite 中使用了它。

I really don't have any idea on what the answer is. But I know Opera supports server-events : http://my.opera.com/WebApplications/blog/show.dml/438711 . Maybe it's a step towards the anwser?
I'm not really sure either, but I think they use it within Opera Unite.

若水般的淡然安静女子 2024-09-05 13:21:11

我认为跨浏览器(包括 Opera)的方法可能是通过 Adob​​e Flash 应用程序传输数据。尽管它会引入对 Flash 插件的依赖,因此并不是很受欢迎。

I think that rather cross-browser (including Opera) approach might be to stream data through an Adobe Flash application. Though it would introduce dependence on the Flash plugin and is not very popular because of that.

卸妝后依然美 2024-09-05 13:21:11

我是一个正在进行中的 C++ HTTP 服务器的作者,该服务器与 goog.netBrowserChannel 兼容。您可以在此处找到我在研究协议时编写的文档:

http: //code.google.com/p/libevent-browserchannel-server/wiki/BrowserChannelProtocol

长话短说,BrowserChannel 在 IE 上使用永久帧,在所有其他浏览器上使用 XHR 流。该协议分为几个阶段,第一个阶段是网络测试:

1)测试网络以确保支持响应“流”(换句话说,不存在缓冲代理)
2)检查对各种网络前缀的访问(以确保网络管理员没有阻止聊天访问)

然后就可以开始实际的数据传输。数据分为两个通道(前向和后向)。反向通道是一系列长期存在的请求(每个请求大约 4 分钟),用于服务器将内容“流式传输”到客户端。为此,使用 HTTP 分块编码。客户端会尽力确保一个反向通道始终打开。服务器大约每 4 分钟关闭一次,之后客户端将打开一个新的反向通道。前向通道用于将数据从客户端发送到服务器。这种数据推送是根据需要进行的。

I am the author of an in progess C++ HTTP server that is compatible with goog.netBrowserChannel. You can find the docs I've written while studying the protocol here:

http://code.google.com/p/libevent-browserchannel-server/wiki/BrowserChannelProtocol

Long story short, BrowserChannel uses forever frames on IE and XHR streaming on all other browsers. The protocol is divided into several phases, the first of which is network testing:

1) test the network to ensure response "streaming" is supported (in other words no buffering proxy exists)
2) check access to a variety of network prefixes (to make sure the network admin has not blocked access to chat)

Then the actual data transmission can start. Data is divided into two channels (forward and back). The back channel is a series of long lived (about 4 mins each) requests used for the server to "stream" content to the client. To do so HTTP chunked encoding is used. The client does it's best to make sure that one backchannel is always open. The server will close it about every 4 mins after which the client will open a new backchannel. The forward channel is used to send data from the client to the server. This pushing of data is done as necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文