Why I am unable to use CURL for websocket?

You can’t use cURL for websocket. WebSocket doesn’t use the HTTP request-response model that cURL is designed for. This is because HTTP is half-duplex, meaning its messaging ability is unidirectional, where the client app sends a request, and then the server sends a response.