没有合适的资源?快使用搜索试试~ 我知道了~
websocket权威指南,要想学习新技术,最好看英文原版,这就是你想要的!
需积分: 20 20 下载量 146 浏览量
2017-08-03
11:01:41
上传
评论
收藏 3.81MB PDF 举报
温馨提示
试读
143页
websocket权威指南,要想学习新技术,最好看英文原版,这就是你想要的!
资源推荐
资源详情
资源评论
JAVASCRIPT PROGRAMMING LANGUAGES
WebSocket
ISBN: 978-1-449-36927-9
US $24.99 CAN $28.99
“
This book walks through
a number of useful
examples, easily applied
to the real world, along
with discussions of
issues that developers
will find when working
with the WebSocket
protocol.
”
—Joseph B. Ottinger
Senior Engineer, Edifecs, Inc.
“
A complete introduction
to WebSocket concepts
and implementation
details.
”
—Arun Gupta
Director of Developer Advocacy, Red Hat
Twitter: @oreillymedia
facebook.com/oreilly
Until recently, creating desktop-like applications in the browser meant
using inefficient Ajax or Comet technologies to communicate with the
server. With this practical guide, you’ll learn how to use WebSocket, a
protocol that enables the client and server to communicate with each
other on a single connection simultaneously. No more asynchronous
communication or long polling!
For developers with a good grasp of JavaScript (and perhaps Node.js),
author Andrew Lombardi provides useful hands-on examples throughout
the book to help you get up to speed with the WebSocket API. You’ll also
learn how to use WebSocket with Transport Layer Security (TLS).
■ Learn how to use WebSocket API events, messages, attributes,
and methods within your client application
■ Build bidirectional chat applications on the client and server
with WebSocket as the communication layer
■ Create a subprotocol over WebSocket for STOMP 1.0, the
Simple Text Oriented Messaging Protocol
■ Use options for older browsers that don’t natively support
WebSocket
■ Protect your WebSocket application against various attack
vectors with TLS and other tools
■ Debug applications by learning aspects of the WebSocket
lifecycle
Andrew Lombardi, owner of consulting firm Mystic Coders, has spent the past
six years giving dozens of talks at conferences all over North America and Europe
on topics ranging from backend Java development and HTML5 to building for
mobile using only JavaScript.
www.it-ebooks.info
978-1-449-36927-9
[LSI]
WebSocket
by Andrew Lombardi
Copyright © 2015 Mystic Coders, LLC. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editors: Simon St. Laurent and Brian MacDonald
Production Editor: Colleen Lobner
Copyeditor: Kim Cofer
Proofreader: Sharon Wilkey
Indexer: Wendy Catalano
Interior Designer: David Futato
Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
September 2015: First Edition
Revision History for the First Edition
2015-09-04: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781449369279 for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. WebSocket, the cover image of a sea
anemone, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
www.it-ebooks.info
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1.
Quick Start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Getting Node and npm 2
Installing on Windows 2
Installing on OS X 2
Installing on Linux 2
Hello, World! Example 3
Why WebSocket? 7
Summary 8
2.
WebSocket API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Initializing 9
Stock Example UI 11
WebSocket Events 12
Event: Open 13
Event: Message 14
Event: Error 15
Event: PING/PONG 15
Event: Close 15
WebSocket Methods 16
Method: Send 16
Method: Close 17
WebSocket Attributes 18
Attribute: readyState 18
Attribute: bufferedAmount 19
Attribute: protocol 19
Stock Example Server 19
iii
www.it-ebooks.info
剩余142页未读,继续阅读
资源评论
75闪光雷
- 粉丝: 131
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功