WebSocket is a protocol that HTML5 began to provide for full-duplex communication over a single TCP connection. In the WebSocket API, the browser and server only need to shake hands, and then a fast lane is formed between the browser and the server. Data can be transmitted directly between the two. The browser sends a request to the server to establish a WebSocket connection through Javascrip{filter}t, and once the connection is established, the client and server can directly exchange data through the TCP connection. When you get a Web Socket connection, you can send data to the server via the send() method and receive the data returned by the server via the onmessage event.
We know that we can use js to connect, so how to use .net/c# to simulate connecting to websockets? ?
I found a websocket online server with the address:
What I send him, what message he replies, so I save time to build the server.
The following is a software simulation client to connect to the websocket server, and it can be used normally.
Source code download:
Tourists, if you want to see the hidden content of this post, please Reply
|