Open Mahdi-Ba opened 2 weeks ago
Hi @Mahdi-Ba, can you provide a full example, as I can't reproduce the problem you are having with the following script
import ws from 'k6/ws';
export default function() {
const url = 'wss://echo.websocket.org';
let res = ws.connect(url, function(socket) {
socket.on('error', console.log)
socket.on('open', function open() {
console.log('connected');
socket.send("hello");
socket.setTimeout(function timeout() {
socket.close()
}, 1000);
socket.setInterval(function timeout() {
socket.send("other mesasage");
}, 500);
});
socket.on('message', (msg) => console.log('message!', msg));
});
if (res.status != 101) {
console.log(JSON.stringify(res));
}
}
Brief summary
in websockets protocol
k6 version
v0.52.0
OS
macOS M1 14.3.1 (23D60) Sonoma
Docker version and image (if applicable)
No response
Steps to reproduce the problem
I submit message but any message received in server in websockets protocol
Expected behaviour
I Expected without interval I receive message too
Actual behaviour
in websockets protocol with interval, I receive But in normal behavior doesn't work