小编Ami*_*hah的帖子

使用React Native客户端和Jetty Spring服务器的无效Sec-WebSocket-Accept响应

var ws = new WebSocket('ws://localhost:8080/activity/hello');

ws.onopen = () => {
    // connection opened
    ws.send('something'); // send a message
};

ws.onmessage = (e) => {
   // a message was received
    console.log(e.data);
};

ws.onerror = (e) => {

    // an error occurred
    console.log(e.message);
};

ws.onclose = (e) => {
    // connection closed
    console.log(e.code, e.reason);
};
Run Code Online (Sandbox Code Playgroud)

如何获得服务器返回的值?客户还期望什么?

谢谢阿米什

spring-websocket react-native

5
推荐指数
0
解决办法
363
查看次数

标签 统计

react-native ×1

spring-websocket ×1