Hack Forums
[C#] Can't Open WebSocket [C#] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Can't Open WebSocket [C#] (/showthread.php?tid=6043999)



Can't Open WebSocket [C#] - grweh3wrh - Jan 25, 2020

I'm new to websockets, and I'm trying to open a websocket with Tidio. However, I don't see authentication anywhere.

This is my current code:



This is what Chrome tells me the WebSocket headers are:

[Image: 6GhnWci.png]

This is what the C# code gives me when I launch [the messages on chrome go beyond that, but the C# gets stuck at connected]:

[Image: fKI3CT5.png]

Any ideas? As I said, I'm new to WebSockets, so I'm not really sure where to go from here.

Thanks  🤝


RE: Can't Open WebSocket [C#] - grweh3wrh - Jan 29, 2020

Can anyone help me with websockets?


RE: Can't Open WebSocket [C#] - StarZ - Jan 30, 2020

May try on StackOverflow, This forum seems pretty dead nowadays.

I myself have very little experience with WebSockets, but I did find this:
https://github.com/Marfusios/websocket-client
Which may be of use.


RE: Can't Open WebSocket [C#] - gigajew - Jan 30, 2020

(Jan 30, 2020 12:46 AM)StarZ Wrote:  May try on StackOverflow, This forum seems pretty dead nowadays.

I myself have very little experience with WebSockets, but I did find this:
https://github.com/Marfusios/websocket-client
Which may be of use.

I don’t think it’s dead. I don’t think too many people have worked with web sockets before and refrain from posting. Is this a custom library for web sockets anyway? How are we supposed to know how that library works? There’s too little information in the OP.


RE: Can't Open WebSocket [C#] - grweh3wrh - Jan 30, 2020

(Jan 30, 2020 12:46 AM)StarZ Wrote:  May try on StackOverflow, This forum seems pretty dead nowadays.

I myself have very little experience with WebSockets, but I did find this:
https://github.com/Marfusios/websocket-client
Which may be of use.

I'm already using a good library with custom headers & loads of cool stuff which is also good.

I just don't know where the authentication is, because it's not present in headers. If anyone has experience, help would be much appreciated 🤝


RE: Can't Open WebSocket [C#] - gigajew - Jan 30, 2020

(Jan 30, 2020 09:02 AM)grweh3wrh Wrote:  I'm already using a good library with custom headers & loads of cool stuff which is also good.

I just don't know where the authentication is, because it's not present in headers. If anyone has experience, help would be much appreciated  🤝

Again we'd need to know what library you're using to even get started helping you.


RE: Can't Open WebSocket [C#] - grweh3wrh - Jan 30, 2020

(Jan 30, 2020 05:13 PM)gigajew Wrote:  Again we'd need to know what library you're using to even get started helping you.

https://www.nuget.org/packages/websocket-sharp-customheaders/

Basically : https://github.com/sta/websocket-sharp this, but with custom headers.

But I don't see how this influences how to get to the authentication of the websocket.


RE: Can't Open WebSocket [C#] - gigajew - Jan 31, 2020

(Jan 30, 2020 06:03 PM)grweh3wrh Wrote:  https://www.nuget.org/packages/websocket-sharp-customheaders/

Basically : https://github.com/sta/websocket-sharp this, but with custom headers.

But I don't see how this influences how to get to the authentication of the websocket.

Because it may not have been implementing authentication for all we know. If we don’t know the code we don’t know what it’s excepted to do and what it actually does. Thanks for posting the library I’ll investigate when I get time.


RE: Can't Open WebSocket [C#] - grweh3wrh - Feb 1, 2020

(Jan 31, 2020 09:29 PM)gigajew Wrote:  Because it may not have been implementing authentication for all we know. If we don’t know the code we don’t know what it’s excepted to do and what it actually does. Thanks for posting the library I’ll investigate when I get time.

Thank you mate, that's very helpful of you :)

You can create a free tidio account if that helps


RE: Can't Open WebSocket [C#] - grweh3wrh - Feb 3, 2020

(Jan 31, 2020 09:29 PM)gigajew Wrote:  Because it may not have been implementing authentication for all we know. If we don’t know the code we don’t know what it’s excepted to do and what it actually does. Thanks for posting the library I’ll investigate when I get time.

Did you find anything?


RE: Can't Open WebSocket [C#] - gigajew - Feb 3, 2020

(Feb 3, 2020 02:59 PM)grweh3wrh Wrote:  Did you find anything?

All I found so far is that you’re using a fork of the real project on GitHub (one that supports custom headers) and it’s connecting just fine. I think the problem here is that you need to find out their implementation method after successful connection. Do some reverse engineering with your browser when connecting to a chat


RE: Can't Open WebSocket [C#] - grweh3wrh - Feb 4, 2020

(Feb 3, 2020 03:04 PM)gigajew Wrote:  All I found so far is that you’re using a fork of the real project on GitHub (one that supports custom headers) and it’s connecting just fine. I think the problem here is that you need to find out their implementation method after successful connection. Do some reverse engineering with your browser when connecting to a chat

So after you've connected to the websocket, that's when you reckon I need to send the credentials?


RE: Can't Open WebSocket [C#] - gigajew - Feb 4, 2020

(Feb 4, 2020 12:42 PM)grweh3wrh Wrote:  So after you've connected to the websocket, that's when you reckon I need to send the credentials?

I’m not sure but I’m sure their api has something like that