(Solved) Websocket(WSS) is complicated

 

I'm not sure if MQL know their Socket TLS functions aren't suitable for Websocket, i've been spending all time of my every last 5 days searching this forum, that forum and all forum on how to make WSS Websocket work all to no avail.

Should one just go to WinAPI for every little function?

 
Racheal Samson:I'm not sure if MQL know their Socket TLS functions aren't suitable for Websocket, i've been spending all time of my every last 5 days searching this forum, that forum and all forum on how to make WSS Websocket work all to no avail. Should one just go to WinAPI for every little function?

Sockets and Websockets are two different things. You can however use MQL5 Sockets to write a websocket library of your own and it will work.

The existing limitation however, is that you have to grant web address access permission in the MetaTrader Options.

If however, I am misunderstanding your words, then please explain why you say that they are not suitable?

 
I didn't try myself, but some users on this site wrote articles or even sell products about WebSockets using MQL Socket. So I have some doubt about your affirmation, sorry.
 
Fernando Carreiro #:

Sockets and Websockets are two different things. You can however use MQL5 Sockets to write a websocket library of your own and it will work.

The existing limitation however, is that you have to grant web address access permission in the MetaTrader Options.

If however, I am misunderstanding your words, then please explain why you say that they are not suitable?

LOL, I'm not sure if being the smartest qualifies to making MQL Socket work with Websocket Upgrade from HTTP, i've tried all possible to make it work in pure MQL, nothing works; if you need reference to past tries(some since years back), i can get a lot for you.

It just doesn't work for WSS, only the WS.

 

You may be completely depending on this article which is not made to work with wss, As Alain said, there are already products available in marketplace which are working with WSS without any external DLL, it means you have to write your own code, everything is fine with MQL and WSS. I doubt your affirmation too.

 

I eventually got it working with WSS, but mehn MQL Socket is complicated if one has to go by common sense or the book.

 
Alain Verleyen #:
I didn't try myself, but some users on this site wrote articles or even sell products about WebSockets using MQL Socket. So I have some doubt about your affirmation, sorry.
After checking myself, I confirm there is NO problem to have WebSockets, through TLS or without, working with MQL Socket.
 
@Racheal I am looking to create some WSS connections. Please explain how did you get it working with WSS?
 
Alain Verleyen #:
After checking myself, I confirm there is NO problem to have WebSockets, through TLS or without, working with MQL Socket.Ther

There is no problem when connecting through http:// or https:// but not working through ws:// or wss://. I tried to use WebsocketClient.mqh and Socket.mqh libraries. There are only inputs url, port but not http or ws configuration.

Reason: