diff --git a/jquery.websocket.js b/jquery.websocket.js index 5742124..dc859ef 100644 --- a/jquery.websocket.js +++ b/jquery.websocket.js @@ -10,8 +10,9 @@ */ (function($){ $.extend({ - websocket: function(url, s) { - var ws = window['MozWebSocket'] ? new MozWebSocket(url) : window['WebSocket'] ? new WebSocket(url) : { + websocket: function(url, s, protocols) { + protocols = protocols || []; + var ws = window['MozWebSocket'] ? new MozWebSocket(url, protocols) : window['WebSocket'] ? new WebSocket(url, protocols) : { send: function(m){ return false; }, close: function(){} };