Files
Harsh ThakurandGitHub dfcbecdd4f Add websocket test (#2053)
* Add websocket test

Signed-off-by: Harsh Thakur <[email protected]>

* Use trap for exit code

Signed-off-by: Harsh Thakur <[email protected]>

* Remove readme

Signed-off-by: Harsh Thakur <[email protected]>

* Format, go version fix

Signed-off-by: Harsh Thakur <[email protected]>

* Update image name

Signed-off-by: Harsh Thakur <[email protected]>

* Use spec dir

Signed-off-by: Harsh Thakur <[email protected]>

* Change directory before running file

Signed-off-by: Harsh Thakur <[email protected]>

* Use

Signed-off-by: Harsh Thakur <[email protected]>
2021-06-10 12:27:20 +05:30

16 lines
339 B
JavaScript

module.exports = async function(ws, clients) {
ws.on('message', function incoming(data) {
clients.forEach(function each(client) {
client.send(data);
});
});
ws.on('close', function close() {
return {
status: 200,
message: "I am done"
}
});
}