Sunday, June 2, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  34] [ 5]  / answers: 1 / hits: 15299  / 8 Years ago, thu, march 31, 2016, 12:00:00

When I connect to a website who uses websockets, I can get the frames with the Google Developer Tools.



Data from the websocket url



So I would like to get the same data but in a program ( JS, C# ) but I actually have no idea how I should do.



I thought about make a http.request with NodeJS but it's not a http url :/
I thought about make a sample JS client but I couldn't get the data because I wasn't able to send the headers with the 'key'.



The headers



So, I really hope you have a way to help me and sorry for my basic English :(


More From » c#

 Answers
28

WebSockets is a standard technology to implement stateful, persistent connections between clients and servers. It has its own protocol ws:// and wss:// (like https://).



What you need is a proper WebSocket client to receive data from the server.



The problem here is WebSockets it's not a protocol per se. There's no concept of request and response. It's like working with TCP sockets.



If you want to work with WebSockets, NodeJS has Socket.IO client API.



In C#, you should take a look at SignalR.


[#62737] Tuesday, March 29, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amberlykaliac

Total Points: 415
Total Questions: 100
Total Answers: 85

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;