websockets lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- fjabouley · 2021-01-20 10:28 Hello all ! I'm trying to use an API from OVH to get phone calls, from this page https://events.voip.ovh.net/v2/documentation#!/default/post_session Using long poll is OK with synapse, I get an ID, and then I make a long poll http get with (.../session/{id}/events/{method}) I'd like to use websockets, but I tried to create one using TTCPBlockSocket from synapse, but it failed. I know I have to send commands to "upgrade" the connection, but I just cannot manage to connect to the server Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TOVHWebSocket.Execute;// TOVHWebSocket is a threadbegin  Socket := TTCPBlockSocket.Create;   Socket.Connect(FHost, IntToStr(FPort));   socket.SSLDoCOnnect;   Socket.OnStatus := @Self.Status;      if socket.LastError<>0 then log(socket.LastErrorDesc);  while not Terminated do      begin      while Socket.CanRead(1000) do      begin        sleep(1000);       log(Socket.RecvString(1000));      end;      sleep(100);      end;    Socket.Free;end;  I get these errors Network subsystem is unusable Error, 10038,Socket operation on nonsocket Error, 10022,Invalid argument Error, 10022,Invalid argument I think I'm not using the right ssl plugin, or I completely misunderstand how it works... Could someone help me please ? Thanks ! Best regards ---------------------------------------------------------------------- MarkMLl · 2021-01-20 11:35 Not my field but have you seen the recent thread at https://forum.laza rus.freepascal.org/index.php/topic,48565.msg368600.html ? MarkMLl ---------------------------------------------------------------------- fjabouley · 2021-01-21 08:17 Thanks Mark, I'll take a look at the link Best regards ---------------------------------------------------------------------- yus · 2021-01-26 02:13 You can try https://github.com/seryal/sywebsocket