We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
var websocketUrl = "ws://172.29.240.1:8111/websocket/message"; var ws = null; var uniqueId = null; run(); console.setExitOnClose(7e3).show(); function run() { try { if (ws == null) { init(); ws = new WebSocket(websocketUrl); ws.send(JSON.stringify({ "binding": uniqueId })); } sleep(1000); } catch (e) { console.log(e); } } ws.on(WebSocket.EVENT_OPEN, (res, ws) => { console.log('open'); console.log(res); }) ws.on(WebSocket.EVENT_MESSAGE, (message, ws) => { console.log('message'); })
代码大致是这样,运行结果是ws可以连接,但是直接打印message而没有打印open 不是很明白为什么ws open的事件没进去 纯纯的新手,希望大家可以不吝赐教 thx
message
open
The text was updated successfully, but these errors were encountered:
No branches or pull requests
代码大致是这样,运行结果是ws可以连接,但是直接打印
message
而没有打印open
不是很明白为什么ws open的事件没进去
纯纯的新手,希望大家可以不吝赐教
thx
The text was updated successfully, but these errors were encountered: