GoogleChrome/webrtc — pull request #167 by tkchin (2014-10-20 23:04:34+00:00)
Title: AppRTC with WebSockets

Two major changes:
1. Updated app engine to provide handlers for running AppRTC using WebSockets using the server at https://apprtc-ws/webrtc.org:8089.
The new flow is:
- caller GETs a new room from AppRTC
- caller begins opening WebSocket to WebSocketServer (WSS)
- caller POSTs SDP offer message to GAE
- SDP offer message is stored
- answerer GETs caller's room
- GAE provides offer SDP in served JS then deletes the copy on GAE
- answerer begins opening WebSocket to WSS
- answerer POSTs SDP answer message to web socket server
- WSS transmits answer to caller once prior connection is established
- all further signaling happens over WSS connection instead of POST

On hangup, client sends BYE to both GAE and other client. GAE deletes room and other client shuts itself down.
Removed ability to rejoin the room, and ability to perform a loopback call for simplicity in this CL.

2. Refactored AppRTC main.js into several modules - apprtc.js, signaling.js, stats.js, infobox.js, util.js, logging.js, pubsub.js
- mostly structural aside from WSS changes. Uses a pubsub model to decouple the modules.

Unchanged:
- Current handlers and behavior using GAE Channels API should be unaffected.

Future work:
- Ability to rejoin room
- Loopback call
- Cleanup apprtc.py to use only WebSocket model once mobile demos are updated.