Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocketjs needs a getter property for readyState #7

Open
ghost opened this issue Oct 9, 2011 · 0 comments
Open

websocketjs needs a getter property for readyState #7

ghost opened this issue Oct 9, 2011 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 9, 2011

When I use jWebSocket on phonegap, it checks for readyState as a property and errors when notdefined gets returned.

        if( this.fConn.readyState == jws.OPEN ) {
            this.fConn.close();
        }

Here, this.fConn is the WebSocket defined in websocket.js

I placed the following prototype addition in my copy of the js file to fix the issue:

WebSocket.prototype.__defineGetter__("readyState", function(){
            return this.socket.getReadyState();
        })

This should be placed in the project as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants