17
CONSUMING ASP.NET WEB API WITH WEBSOCKETS Maayan Glikser

Consuming ASP.NET Web API with WebSockets

Embed Size (px)

Citation preview

CONSUMING ASP.NET WEB API WITH WEBSOCKETS

Maayan Glikser

Maayan Glikser

- Github addict - Hardcore Metal Fan - Converted from dogs to cats

Developer @ 500Tech

What are WebSockets?

How WebSockets Work?

Why use WebSockets for API's?

How TCP Works

Diagnosing in Chrome Network Tool

Typical Ajax Request

TCP Slow-Start

* From High Performance Browser Networking by Ilya GrigorikChapter 1. Primer on Latency And Bandwidth

Advantages• No HTTP Overhead

• Duplex Connection - Server is able to send updates

• Low latency requests - TCP Connection is already open

• Data transfer grows as more data comes through the pipe

• Can send binary data

• Cross Origin

Disadvantages• No Caching

• No Proxies

• Clients can lose connection to the server

• Compatibility (IE9 and below)

• Security - CSWSH (Cross Origin Web Socket Hijacking)

How to use WebSockets for REST API's

WAMPWeb Application Messaging protocol

www.iana.org/assignments/websocket/websocket.xml#subprotocol-name

WAMP Router

DEMO

Resources• WAMP Protocol

http://wamp.ws/

• High performance Browser Networking By Ilya Grigorik http://chimera.labs.oreilly.com/books/1230000000545

• Web Sockets Security http://www.christian-schneider.net/CrossSiteWebSocketHijacking.html

• More Bandwidth Doesn't matter https://docs.google.com/a/chromium.org/viewer?

srcid=Y2hyb21pdW0ub3JnfGRldnxneDoxMzcyOWI1N2I4YzI3NzE2

WE ARE HIRING

Check the slides:

Read our blog:http://blog.500tech.com

Maayan Glikser

http://bit.ly/1C4PJsQ

[email protected]