/* * Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. * W3C liability, trademark and document use rules apply. * * W3C The Web Sockets API * W3C Working Draft 21 April 2009 * http://dev.w3.org/html5/websockets/ */ #ifndef _WEBSOCKETS_IDL_ #define _WEBSOCKETS_IDL_ #include "w3c/html5.idl" module websockets { typedef html5::Function Function; [Constructor(in DOMString url)] interface WebSocket { readonly attribute DOMString URL; // ready state const unsigned short CONNECTING = 0; const unsigned short OPEN = 1; const unsigned short CLOSED = 2; readonly attribute long readyState; // networking attribute Function onopen; attribute Function onmessage; attribute Function onclose; void postMessage(in DOMString data); void disconnect(); }; }; // module websockets #endif // _WEBSOCKETS_IDL_