graphic with four colored squares

Web Sockets: Protocol and API

Using HTTP 1.1 Upgrade directive and subject to origin constraints

interface WebSocket {
  // e.g. "ws://example.com/app34"
  readonly attribute DOMString URL; 
  [...]
  readonly attribute unsigned long bufferedAmount;
           attribute Function onopen;
           attribute Function onmessage;
           attribute Function onclose;
  boolean send(in DOMString data);
  void close();
};