万本电子书0元读

万本电子书0元读

顶部广告

Practical XMPP电子书

售       价:¥

8人正在读 | 0人评论 9.8

作       者:Lloyd Watkin,David Koelle

出  版  社:Packt Publishing

出版时间:2016-09-01

字       数:89.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Unleash the power of XMPP in order to build exciting, real-time, federated applications based on open standards in a secure and highly scalable fashion About This Book Learn about the fundamentals of XMPP and be able to work with the core functionality both server-side and in the browser Build a simple 1-to-1 chat (the “Hello World” of XMPP), explore multi-user chat, publish subscribe systems, and work with a decentralized social network Author Lloyd Watkins is a member of the XMPP standards committee Who This Book Is For If you want to learn about the fundamentals of XMPP, be able to work with the core functionality both server-side and in the browser then this book is for you.No knowledge of XMPP is required, or of TCP/IP networking. It's important that you already know how to build applications of some form, and are looking get a better understanding of how to implement XMPP for one or more of its many uses. You should be interested in the decentralized web, know HTML, and likely know JavaScript and NodeJS. You will probably know JSON, and hopefully XML (this is the native output of XMPP). What You Will Learn Install and configure an XMPP server and use it to connect from a traditional desktop client and send a message Build a simple server-side application that will respond to messages from our logged in desktop client Install and run XMPP-FTW, connect to the server from the browser, and handle incoming/outgoing messages Connect to a multi-user chat room, send/receive stanzas, add a room password, join a protected room, set the room’s subject, and change a user's affiliation Get to grips with the publish-subscribe extension of XMPP and use it to build a pusher system that can make any website real-time Build a simple XMPP component and create an extension for XMPP-FTW that allows you to use your own custom format Build an XMPP version of the classic game “Pong” In Detail XMPP (eXtensible Messaging and Presence Protocol) is a messaging protocol that enables communication between two or more devices via the Internet. With this book, developers will learn about the fundamentals of XMPP, be able to work with the core functionality both server-side and in the browser, as well as starting to explore several of the protocol extensions. You will not only have a solid grasp of XMPP and how it works, but will also be able to use the protocol to build real-world applications that utilize the power of XMPP. By the end of this book, you will know more about networking applications in general, and have a good understanding of how to extend XMPP, as well as using it in sample applications. Style and approach Through a number of hands-on projects, this book shows you how to build usable applications that highlights a feature of XMPP.
目录展开

Practical XMPP

Practical XMPP

Credits

About the Authors

About the Reviewers

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. An Introduction to XMPP and Installing Our First Server

What is XMPP?

Uses of XMPP

XMPP and the Web

Installing Node.js and library dependencies

Installing our XMPP server

Installing the server

Configuring the server

Testing our setup

Creating a test account

Installing an XMPP client

Summary

2. Diving into the Core XMPP Concepts

Introducing the Jabber ID

Message routing

Basic building blocks of XMPP communication

<presence/>

Presence subscriptions

Directed Presence

Client capabilities

Presence overloading

<message/>

Delivery receipts

XHTML-IM

Chat state notifications

<iq/>

Summary

3. Building a One-on-One Chat Bot - The "Hello World" of XMPP

C2S connection life cycle

Authenticating with a server

Installing node-xmpp-client

Building our echo bot

Creating a new user

Connecting to the server

Telling the server we're online

Listening for incoming stanzas

Reading the chat stanza with ltx

Responding to incoming messages

Extending our echo bot

Responding to presence subscription requests

Returning results from DuckDuckGo Instant Answers API

Sending chat state notifications

Signing off

Summary

4. Talking XMPP in the Browser Using XMPP-FTW

Interacting with XMPP in the browser

BOSH

The WebSocket protocol

Introducing XMPP-FTW

Installing XMPP-FTW

Playing with XMPP-FTW using the demo application

Talking to our bot from the browser

Building a WebSocket-enabled web server in Node.js

Talking WebSockets from a browser

Installing XMPP-FTW and getting messaging!

Chatting with our XMPP bot

Login

Interacting with the chat bot

Seeing what the chat bot is up to...

Hello (hello, hello...)! Is there anybody out there?

Summary

5. Building a Multi-User Chat Application

The basics of MUC

Joining a room

Your role and identity within a room

Sending and receiving messages

Discovering MUC

Configuring our chat room using data forms

The basics of the data form

Getting our MUC room configuration

Updating the room configuration

Data forms in XMPP-FTW

Creating a chat room

Managing the users

Configuration updates

Leaving a room

Destroying the room

Building with XMPPMUC

Updating Prosody to provide an MUC service

Connecting with our XMPP client

Extending our chat bot to work with an MUC

Writing a browser-based MUC client

Setting things up server-side

Building the client

Connecting anonymously

Listing the available chat rooms

Where the action happens

Displaying the chat room HTML and handling users

Handling incoming messages

Sending a message

Wrapping up

Summary

6. Make Your Static Website Real-Time

Are we there yet?

Interacting with Publish-Subscribe

Discovery

Subscribing

Subscriptions, affiliations, and access models

Creating and configuring nodes

Retrieving items

Publishing items

Making your website real-time

Configuring Prosody

Building a server-side publishing mechanism

Building our real-time client

Setting up the server

Lining up our static website

Let's get real-time...

Subscribing to a node

Retrieving historical results

Getting real-time

Taking things further

Summary

7. Creating an XMPP Component

Connection flow for components

Configuring a component in Prosody

Building our first XMPP component

Creating a component and connecting it to the server

Receiving a stanza and responding to a DISCO#info query

Responding to a chat message

Creating a client that connects to the component

Running your new component and client

Summary

8. Building a Basic XMPP-Based Pong Game

Overview of Basic XMPP Pong

Getting Started

Developing the HTML canvas

Adding the mouse listeners for moving the paddle

Drawing and updating the game

Sending and receiving XMPP messages in Pong

Sending and receiving a Hello message

Sending a paddle update

Receiving a paddle update

Connecting the clients

Advertising the Pong feature of clients (Client DISCO)

Issues with a basic implementation

Summary

9. Enhancing XMPPong with a Server Component and Custom Messages

Designing the information flow for XMPPong

Developing the XMPP component for XMPPong

Setting up a game loop in the component

Starting and updating the game

Maintaining the ball state in the component

Bounces and misses

Expecting paddle updates

Implementing messages from the component to the clients

Handling incoming messages from the clients

Handing DISCO#info requests

Creating an XMPP-FTW extension to read messages within our namespace

Developing the client

Starting the XMPP-FTW server

Checking in to the component and receiving dimensions

Drawing code in the client

Modifying the browser view

Running the server and clients

Summary

10. Real-World Deployment and XMPP Extensions

Server Modules

DNS setup and SRV records

Server-to-server communications

XMPP security

XMPP scalability

User Registration

About the XMPP Standards Foundation

XMPP and the new rise of multi-user chat

XMPP and the Internet of Things

XMPP and Universal Plug-n-Play

XMPP and WebRTC

The Future of XMPP

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部