Webinar: Building WebSocket Browser Applications with Spring

本文探讨了如何使用WebSocket和Spring框架构建实时双向通信应用,包括消息格式、发布订阅模式、安全性及验证等内容。

News and Events
Pieter Humphrey
September 24, 2013

So, you’ve written a “Hello world!” WebSocket application or perhaps even a chat sample. You’re able to exchange messages even in pre-Servlet 3.1 containers and pre-IE 10 browsers (that don’t yet support WebSocket) thanks to the SockJS protocol and Spring’s support for it. However a message is a blank page that can have any content. Whatever message format you choose, proprietary or standard, both client and server need to understand it as well as distinguish different kinds of messages. You need support for the publish-subscribe pattern central to messaging applications so you can broadcast messages to one or more subscribers. You need to incorporate security, validation, and so on. In short you need to build a real-world application. If you’re used to web applications (and Spring MVC annotated controllers) you are familiar with the foundation that HTTP provides including URLs (nouns), HTTP methods (verbs), headers, parameters, and others. Imagine building an application without HTTP, just a socket. WebSocket gives you this brand new, exciting capability – full duplex, two-way communication – yet you no longer have an application-level protocol. Can an entire application be built around a single Endpoint class processing all messages, assuming a single WebSocket connection between browser and server? Join Rossen Stoyanchev as he demonstrates that, thankfully, the WebSocket protocol has a built-in sub-protocol mechanism.

Europe

Tuesday, October 8 3:00PM GMT Summer Time London, GMT+01:00)

Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=667384670

North America

Tuesday, October 8 10:00AM PDT San Francisco, GMT-07:00)

Register https://gopivotal.webex.com/gopivotal/onstage/g.php?t=a&d=660130258
comments powered by Disqus

translate:
翻译:

所以,你写了一个“你好的世界!”WebSocket应用程序,甚至可能是一个聊天示例。由于SockJS协议和Spring对它的支持,您甚至可以在pre-Servlet 3.1容器和pre-IE 10浏览器(还不支持WebSocket)中交换消息。但是,消息是可以包含任何内容的空白页。无论您选择哪种消息格式,专有的还是标准的,客户机和服务器都需要理解它并区分不同类型的消息。您需要对消息传递应用程序中心的发布-订阅模式提供支持,以便可以向一个或多个订阅者广播消息。您需要结合安全性、验证等。简而言之,您需要构建一个真实的应用程序。如果您已经习惯了Web应用程序(和Spring MVC注释的控制器),您就熟悉HTTP提供的基础,包括URL(名词)、HTTP方法(动词)、标头、参数等。想象一下构建一个没有HTTP的应用程序,仅仅是一个套接字。WebSocket为您提供了这种全新的、令人兴奋的功能——全双工、双向通信——但您不再拥有应用程序级协议。假设浏览器和服务器之间只有一个WebSocket连接,那么整个应用程序能否围绕一个处理所有消息的端点类构建?加入Rossen Stoyanchev,因为他演示了,谢天谢地,WebSocket协议有一个内置的子协议机制。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值