diff --git a/client/index.js b/client/index.js index 4093392..877d517 100644 --- a/client/index.js +++ b/client/index.js @@ -37,7 +37,7 @@ class WSClient extends EventEmitter { if (this.connectState !== 2) { if (message === '\x00\x02') { this.connectState = 2 - this.emit('ready') + this.emit('connect') } else { this.emit('error', new Error('Client version mismatch.')) } diff --git a/test/cases/ws-client.js b/test/cases/ws-client.js index 8656e4f..4398315 100644 --- a/test/cases/ws-client.js +++ b/test/cases/ws-client.js @@ -6,7 +6,7 @@ module.exports = function ({ HTTP_PORT }) { ws.on('error', reject) - ws.on('ready', async () => { + ws.on('connect', async () => { try { { const data = { 'Hello': 'World' } diff --git a/test/cases/wss-client.js b/test/cases/wss-client.js index dfaf7f2..b08afef 100644 --- a/test/cases/wss-client.js +++ b/test/cases/wss-client.js @@ -6,7 +6,7 @@ module.exports = function ({ HTTPS_PORT }) { ws.on('error', reject) - ws.on('ready', async () => { + ws.on('connect', async () => { try { { const data = { 'Hello': 'World' }