normally, one wants a "websocket out" node to connect to a server in order to send a message and a "websocket in" node to connect as well in order to receive the response.
But, how can one programmatically shut down that connection as soon as all messages have been sent and all responses received?
Changing the flow and redeploying it is not an option - the disconnect shut be done by the flow itself.
The WebSocket.close() method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED , this method does nothing.
There is much between single HTTP request-response messages and "everlasting" WebSocket connections but it might not be easy to map features such as
For a simple websocket server both the client and the server have the same rights to close the connection. So it looks like you can issue a .close method from the server.