I have been going through this websockets article.
Can a web-socket communicate with a TCP/UDP Socket and viceversa?
I have been going through this websockets article.
Can a web-socket communicate with a TCP/UDP Socket and viceversa?
Websockets use TCP sockets. Websockets are a higher level technology relying on TCP sockets, exactly the same way HTTP is transported over TCP sockets. In fact, Websockets are a special extension of HTTP. The client issues a special HTTP request that leaves the underlying TCP socket open, which then allows both the client and the server to push data on the connection.
What you essentially need is a WebSockets client library in your application. This will utilise TCP sockets on a lower level, and talk to your webserver using the WebSockets protocol.
The benefit of this approach is that your application code only has to deal with the library's higher-level API as well, instead of the nitty-gritty sockets API, where you'll have to implement HTTP and/or WebSockets again.