You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
make JS=samples/websockets/WebSocketServer.js ROM=256
make dfu
set up BLE connection echo "connect FF:EE:DD:CC:BB:AA 2" > /sys/kernel/debug/bluetooth/6lowpan_control ip -6 route add 2001:db8::/64 dev bt0 ip -6 addr add 2001:db8::2 dev bt0
Verified with commit 2273038 in master. Result is as below:
On my Linux(Ubuntu 16.04): This issue is still reproduced. All websocket server can't be connected with error "Unexpected server response:{}". But it works fine with zjs-0.5.
On another Linux(Ubuntu 16.04): This issue is not reproduced. Websocket server can be connected.
I am not sure whether it is caused by test environment or network connection issue.
So close it for now, and I will create another issue if new problem occurred.
When we use ws 5.1.0 above, the protocols ["first", "my_ws_protocol", "last"] in NodeWebSocketClient.js will be joined with ', ', websocket server receive the protocols with a white space before each protocol expect the first one:
var wss = new WebSocket.Server({
port: 8080,
acceptHandler: function(protos) {
for (var i = 0; i < protos.length; i++) {
console.log('protos:' + protos[i])
if (protos[i] == "my_ws_protocol") {
return protos[i];
}
}
return false;
}
});
output:
No protocol match with my_ws_protocol, there is error thrown with 'unexpected server response'.
In Node ws module, the server trim the received protocols to align with client.
if (protocol) {
protocol = protocol.trim().split(/ *, */);
We are not sure the end-user always install latest ws module, so could you do the same trim for protocols in zjs code? or expose trim() API to handle it in JavaScript code, now there is no such kind of method for String.
Description
This is a regression issue, after zephyr updated to 1.11. NodeWebSocketClient cannot connect to WebsocketServer.
Test Code
WebSocketServer.js;
NodeWebSocketClient.js;
WebSocketServer4.js;
NodeWebSocketClient4.js;
test-ws4-server-dhcp.js
test-ws4-client-dhcp.js
test-ws4-server.js
test-ws4-client.js
test-ws6-server.js
test-ws6-client.js
Steps to Reproduction
make JS=samples/websockets/WebSocketServer.js ROM=256
make dfu
echo "connect FF:EE:DD:CC:BB:AA 2" > /sys/kernel/debug/bluetooth/6lowpan_control
ip -6 route add 2001:db8::/64 dev bt0
ip -6 addr add 2001:db8::2 dev bt0
Node samples/websockets/NodeWebSocketClient.js
Actual Result
Expected Result
Test Builds
Additional Information
The text was updated successfully, but these errors were encountered: