Jump to content
Taki04

Delphi ICS HttpServer +socket

Recommended Posts

var ARequestInfo := THttpConnection(Client);
if SameText(ARequestInfo.RequestConnection,'Upgrade') then
      ARequestInfo.Answerstring(Flags, '101', '',
                            'Upgrade: websocket' + #13#10 +
                            'Connection: Upgrade' + #13#10 +
                            'Sec-WebSocket-Accept: ' + WebSocketAccept, '');//WebSocketAccept is working good with idhttpserver

what ever i do i can't make this work and its just the first step
maybe i am trying wrong way maybe  i need to use ARequestInfo.Send(TWSocketdata,len)
or ARequestInfo.StartConnection;
idk what i have to do to make handshake then send client alert from server

 

Share this post


Link to post

Are you using an old version of ICS? 

 

ICS added full Websocket server and client support two years ago, and handles the upgrade negotiation process automatically. 

 

The main unit is OverbyteIcsWebSocketSrv.pas which contains a derived connection class THttpWSSrvConn that handles the Websocket protocol. 

 

There are two samples OverbyteIcsSslMultiWebServ.dpr and IcsAppMon.dpr that show how it all works.

 

Angus

 

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×