Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4174031
  • 博文数量: 291
  • 博客积分: 8003
  • 博客等级: 大校
  • 技术积分: 4275
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-30 18:28
文章分类

全部博文(291)

文章存档

2017年(1)

2013年(47)

2012年(115)

2011年(121)

2010年(7)

分类: 系统运维

2012-07-29 15:47:04

What is WebSocket?

什么是WebSocket?

The WebSocket specification—developed as part of the HTML5 initiative—introduced the WebSocket JavaScript interface, which defines a full-duplex single socket connection over which messages can be sent between client and server. The WebSocket standard simplifies much of the complexity around bi-directional web communication and connection management.

WebSocket represents the next evolutionary step in web communication compared to Comet and Ajax. However, each technology has its own unique capabilities. Learn how these technologies vary so you can make the right choice.

 

规范-——成熟的HTML5技术创新——WebSocket javascript接口是什么?它是一个全双工的socket连接,通过这个socket连接我们可以在客户端和服务端之间传递信息。WebSocket标准大大简化了网络通讯双方的复杂性和连接管理。

和长连接和Ajax相比,WebSocket 代表着进入网络通讯下一次革命。但是每一项技术都有它自身独有的能力。学会这些技术变革,你就可以选择正确的技术去完成你的工作。

 

Creating your own test

创建你自己的测试

Using a text editor, copy the following code and save it as websocket.html somewhere on your hard drive. Then simply open it in a browser. The page will automatically connect, send a message, display the response, and close the connection.

把下面的代码复制到编辑器里,并且保存为websocket.html。然后用浏览器打开它。这个页面会自动连接,发送一个消息,显示响应内容,最后关闭(ps:我自己试了chrome11下是可以的,firefox4IE9不行

WebSocket Test

WebSocket Test

 

 

 

  WebSocket Demos

WebSocket 演示例子

Here you will find an aggregated list of WebSocket demos from all over the Web.

在本章你能够找到一批从网上精选的WebSocket 演示例子

Echo Test

回应测试

Test a WebSocket connection from your browser against our WebSocket echo server.

测试一个从你浏览器到我们WebSocket 回应服务器的WebSocket连接,这个例子演示了从发起WebSocket,发送消息,收到并显示你发出的消息,最后关闭的过程

 

 

 

 

Kaazing.me

和我即时联系

 Several examples of WebSocket together on the one page. The bar along the bottom of the screen lets you connect to Google Chat over WebSocket.

Original link

在一个页面里集合了几个WebSocket的例子。屏幕地下的工具条可以让你通过WebSocket连接到Google 聊天室

 

Mr. Doob's Multiuser Sketchpad

Doob先生的多用户画图板

A shared sketchpad that everyone can draw on at the same time. Websockets are used to keep up with the position data shared between users.

Original link (Demo)

Original link (Article)

一个共享的画图板,每个人都可以同时在它上面画图。Websockets用于保存用户直接共享的画图数据

原连接(演示)

原连接(文章)

 

 

 

Rumpetroll

Norwegian for "tadpole", swim around with other rumpetrolls. WebSockets communicate positional data between all users.

Original link

 

蝌蚪聊天室

在挪威语里叫“tadpole,在其他蝌蚪周围游动。WebSockets负责在所有用户之间传递各自的位置。

原连接

 

WordSquared

A massively multiplayer online Scrabble-like word game.

Original link

单词方格

大量多个玩家在线玩的拼字游戏。

原连接

 

WebGL Aquarium

This is a 100% HTML5, WebGL and JavaScript. Each of the 8 machines is running Chrome. They communicate using WebSockets to coordinate the differenct screens.

Original link

 

webGL 水族馆

这是用纯100%HTML5,WebGLJavaScript语言写的网页。

8个计算机是使用了chrome.他们在不同屏幕下用WebSockets进行通信

原连接

 

The WebSocket Difference

A video that visually demonstrates the performance improvements you get by using WebSocket.

Original link

 

WebSocket的差异

用一个视频形象化给你演示如果你使用WebSocket能提高多少性能。

原连接

 

Video Sync with WebSocket

Shows a single controller controlling the video that all connected users are watching.

Original link

 

WebSocket同步视频

显示一个单一控制器控制这所有在线用户在看的视频

原连接

 

 

阅读(3198) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~