Implement a basic WebSocket interface.

This commit is contained in:
Hinali Marfatia 2014-10-25 23:58:59 -04:00 committed by Ms2ger
parent 10f8fe0067
commit b1d6041420
6 changed files with 79 additions and 36 deletions

View file

@ -0,0 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
[Constructor(DOMString url)]
interface WebSocket : EventTarget {
readonly attribute DOMString url;
//attribute DOMString port;
//attribute DOMString host;
//ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSING = 2;
const unsigned short CLOSED = 3;
//readonly attribute unsigned short readyState;
//readonly attribute unsigned long bufferedAmount;
//networking
//attribute EventHandler onopen;
//attribute EventHandler onerror;
//attribute EventHandler onclose;
//readonly attribute DOMString extensions;
//readonly attribute DOMString protocol;
//void send(USVString data);
//void send(Blob data);
//void send(ArrayBuffer data);
//void send(ArrayBufferView data);
};