Kaazing Gateway Open Source HTML 5 Web Socket Server Speaker - - PowerPoint PPT Presentation

kaazing gateway
SMART_READER_LITE
LIVE PREVIEW

Kaazing Gateway Open Source HTML 5 Web Socket Server Speaker - - PowerPoint PPT Presentation

Kaazing Gateway Open Source HTML 5 Web Socket Server Speaker John Fallows Co-Founder: Kaazing Co-Author: Pro JSF and Ajax, Apress Participant: HTML 5 Community Agenda Networking Review HTML 5 Communication


slide-1
SLIDE 1
slide-2
SLIDE 2

Kaazing Gateway

Open Source HTML 5 Web Socket Server

slide-3
SLIDE 3

Speaker

  • John Fallows
  • Co-Founder: Kaazing
  • Co-Author: Pro JSF and Ajax, Apress
  • Participant: HTML 5 Community
slide-4
SLIDE 4

Agenda

  • Networking Review
  • HTML 5 Communication
  • Kaazing Gateway
  • Kaazing Enterprise Gateway
  • Kaazing Enterprise Gateway
  • Q & A
slide-5
SLIDE 5

Networking Review

  • Desktop Networking

– Full-duplex bidirectional TCP sockets – Access any server on the network

  • Browser Networking
  • Browser Networking

– Half-duplex HTTP request-response – HTTP polling, long polling, streaming – Same-origin HTTP requests

slide-6
SLIDE 6

Half-Duplex Architecture

Java EE Container

sport Logic EJB

RMI - TCP (Full Duplex) JDBC - TCP (Full Duplex)

Database JavaMail IMAP Server

IMAP - TCP (Full Duplex) RMI

Servlet

Browser

Application Transpo JMS

HTTP (Half Duplex)

Stock Trading Client IM Server JavaMail IMAP Server

JABBER - TCP (Full Duplex) JMS - TCP (Full Duplex) RMI

JMS Stock Trading Feed

Custom - TCP (Full Duplex)

slide-7
SLIDE 7

HTML 5 Overview

  • Next generation application platform

– Communication (sockets, cross-site) – Graphics (2D) – Drag ‘n’ drop – Drag ‘n’ drop – Storage (transient, persistent) – Offline – Compatibility – Scheduled for completion in 2022 (!)

slide-8
SLIDE 8

HTML 5 Communication

  • WebSocket

– Proxy-friendly text socket for your browser

  • Server-Sent Events

– Standardized HTTP streaming (downstream) – Standardized HTTP streaming (downstream)

  • Cross-Site XMLHttpRequest

– Secure cross-site remote communication

  • postMessage

– Secure inter-iframe communication

slide-9
SLIDE 9

Full-Duplex Architecture

Java EE EJB JDBC - TCP (Full Duplex)

Database

JDBC - TCP (Full Duplex) RMI - TCP (Full Duplex) JMS RMI - TCP (Full Duplex)

erver

Browser

TCP over HTTP (Full Duplex) IMAP - TCP (Full Duplex) Jabber - TCP (Full Duplex)

Stock Trading Feed

Custom - TCP (Full Duplex)

IM Server IMAP Server

WebSocket Serv

slide-10
SLIDE 10
slide-11
SLIDE 11

Kaazing Protocols

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-12
SLIDE 12

Kaazing ByteSocket

  • Provides binary socket abstraction
  • Leverages text-based WebSocket

– Encodes payload using base64

  • Send and receive ByteBuffers
  • Send and receive ByteBuffers

– JavaScript has no byte or ByteArray type (yet)

  • Kaazing Gateway converts base64
slide-13
SLIDE 13

Kaazing ByteSocket

var location = “ws://www.kaazing.org/binary”; var socket = new ByteSocket(location); socket.onmessage = function(event) { alert(event.data.getInt()); } function(event) { alert(event.data.getInt()); } var buf = new ByteBuffer(); buf.putString(“Hello, world”, Charset.UTF8); socket.postMessage(buf.flip());

slide-14
SLIDE 14

Kaazing ByteSocket

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-15
SLIDE 15

HTML 5 WebSocket

  • Provides Full-Duplex Text Socket
  • Send and Receive Strings
  • Enables Streaming to Server Too
  • Browser Support
  • Browser Support

– None (yet)

slide-16
SLIDE 16

HTML 5 WebSocket Schemes

ws://www.kaazing.org/text wss://www.kaazing.org/encrypted-text wss://www.kaazing.org/encrypted-text

slide-17
SLIDE 17

HTML 5 WebSocket API

var location = “ws://www.kaazing.org/text”; var socket = new WebSocket(location); socket.onopen = function(event) { socket.send(“Hello, WebSocket”); } function(event) { socket.send(“Hello, WebSocket”); } socket.onmessage = function(event) { alert(event.data); } socket.onclose = function(event) { alert(“closed”); }

slide-18
SLIDE 18

HTML 5 WebSocket Handshake

GET /text HTTP/1.1\r\n Upgrade: WebSocket\r\n Connection: Upgrade\r\n Host: www.kaazing.org\r\n …\r\n …\r\n HTTP/1.1 101 WebSocket Protocol Handshake\r\n Upgrade: WebSocket\r\n Connection: Upgrade\r\n …\r\n

slide-19
SLIDE 19

HTML 5 WebSocket Frames

  • Frames can be sent full-duplex

– Either direction at any time

  • Text Frames use terminator

\x80Hello, WebSocket\0xff \x80Hello, WebSocket\0xff

  • Binary Frames use length prefix

\x00\0x10Hello, WebSocket

  • Text and binary frames on same WebSocket
slide-20
SLIDE 20

Kaazing WebSocket

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-21
SLIDE 21

HTML 5 Server-Sent Events

  • Standardizes Comet

– JavaScript API – Wire protocol

  • Encourages adoption by servers
  • Encourages adoption by servers
  • Browser Support

– Patch under review for Firefox trunk

slide-22
SLIDE 22

HTML 5 Server-Sent Events

  • HTML DOM Element

<eventsource src=“http://www.kaazing.org/sse”

  • nmessage=“alert(event.data)” >
  • HTML DOM API

var es = document.createElement(“eventsource”); es.addEventListener(“message”, function(event) { alert(event.data); }, false); es.addEventSource(“http://www.kaazing.org/sse”);

slide-23
SLIDE 23

HTML 5 Server-Sent Events

GET /sse HTTP/1.1\r\n Host: www.kaazing.org\r\n Last-Event-ID: 9\r\n …\r\n 200 OK HTTP/1.1\r\n …\r\n :comment\n id: 10\n data: Hello, Server-Sent Events\n \n

slide-24
SLIDE 24
slide-25
SLIDE 25

Kaazing Server-Sent Events

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-26
SLIDE 26

Cross-Site XMLHttpRequest

  • W3C Technical Report

– Access Control for Cross-Site Requests – Published Sept 12, 2008 – http://www.w3.org/TR/access-control/ – http://www.w3.org/TR/access-control/

  • Browser Support

– Firefox 3.1-beta – IE8 XDomainRequest (similar) – Opera, Safari, Chrome coming

slide-27
SLIDE 27

Cross-Site XMLHttpRequest

GET / HTTP/1.1\r\n Host: www.w3.org\r\n Origin: http://www.kaazing.org\r\n …\r\n …\r\n 200 OK HTTP/1.1\r\n Allow-Origin: http://www.kaazing.org\r\n …\r\n

slide-28
SLIDE 28
slide-29
SLIDE 29

Kaazing Cross-Site XHR

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-30
SLIDE 30

HTML 5 postMessage

  • Send Strings Between HTML Documents

– Documents may be served by different sites

  • Standard API

targetWindow.postMessage(message, targetOrigin) targetWindow.postMessage(message, targetOrigin) window.onmessage = function(event) { alert(event.data); }

  • Browser Support

– IE 8, FF 3, Opera 9, WebKit nightlies

slide-31
SLIDE 31
slide-32
SLIDE 32

Kaazing postMessage

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-33
SLIDE 33

Kaazing postMessage

  • HTML 5

– targetWindow.postMessage(message, targetOrigin)

  • Kaazing

– postMessage0(targetWindow, message, targetOrigin) – postMessage0(targetWindow, message, targetOrigin) – Documents must be served by same or peer domains

http://www.kaazing.org:8000/same-domain https://www.kaazing.org:9000/secure-same -domain

  • or -

http://peer0.kaazing.org:8000/peer-domain https://peer1.kaazing.org:9000/secure-peer-domain

slide-34
SLIDE 34

Kaazing Protocols Support

Protocols WebSocket ByteSocket Server-Sent Events Cross-Site XHR postMessage Cookies XHR IFrame

slide-35
SLIDE 35

Kaazing Protocols

  • Text or Binary

– Stomp – XMPP – IRC – IRC – Telnet – IMAP – SMTP – Custom…

slide-36
SLIDE 36

Kaazing Gateway Scalability

  • Concurrency

– Proportional to bandwidth not connections

  • Latency

– Socket integration, bytes-in, bytes-out – Socket integration, bytes-in, bytes-out

  • Stateless

– Minimal memory usage, balancing, failover

slide-37
SLIDE 37

Kaazing Enterprise Gateway

  • Features

– Adobe Flex APIs – Flash runtime detection – EncryptedKeyring – EncryptedKeyring – Single sign-on – Protocol Validation – Protocol Security Enhancements – Management

slide-38
SLIDE 38
slide-39
SLIDE 39

Summary

  • Kaazing Gateway

– HTML 5 WebSocket (and more) today – Open source community

  • http://www.kaazing.org
  • http://www.kaazing.org

– Binary and text protocol support

  • Kaazing Enterprise Gateway

– 60-day free trial

  • http://www.kaazing.com

– 24x7 support available

slide-40
SLIDE 40