Re: [twsocket] HTTPCLI for WebSocket connection ?

2016-01-05 Thread Dod
Hello Angus,

Sure I was not asking for any development ;-)

Right  now  I handle it thru WebSocket, and manage enough of websocket
protocol for the need I have to communicate with an internal server I
have to deal with.

THTTPCli  descendant  should  be OK.

For what I learned until now it would need to :

- Manage HTTP header dedicated to websocket negociation like :

Connection: Upgrade
Upgrade: Websocket
Sec-WebSocket-Version: xx (different Websocket versions)

- Manage Sec-WebSocket-Key mono and double keys handshake with the
BASE64 SHA-1 GUID salt

-  Handle the 2 or 4 bytes binary structured packet that is present in
front  of  each websocket frame (websocket is frame based not streamed
data  flow)  and  contain  among  other  informations  the size of the
upcoming frame, but one thing to take care is that this packet can be
2 or 4 bytes depending the size of the data in the frame.

- There  is  also  a  special  "ping"  keep-alive feature (server and/or
client mode) that can be done thru the packet header.

Neverless the day you want a beta tester I may help.

regards.


>> For people who want to understand how WebSocket protocol works I found
>> a this very interesting and crystal clear article :
>> 
>> http://lucumr.pocoo.org/2012/9/24/websockets-101/

ARMSL> Thanks, I've got various reading about websockets, but no time to think 
about them,
ARMSL> although it is on the long term ICS wish list I published a while ago.

ARMSL> I'm sure you can borrow some of the server side implementation for the 
client,
ARMSL> creating keys and frames will be very similar in client and server.  

ARMSL> My inclination would be client websockets should be a separate ICS 
component, a
ARMSL> descendent of THttpCli, overriding the necessary events, with only minor 
changes in
ARMSL> THttpCli, which is a stable component.  

ARMSL> We also need a test websockets web site, a quick Google suggests some 
echo test
ARMSL> sites (like http://www.websocket.org), but ideally there should be some 
pages on my
ARMSL> public IIS/8.5 server which seems to support websockets (at least it was 
an install
ARMSL> option). 

ARMSL> My priority this month is the ACME protocol to automate acquiring and 
installing SSL
ARMSL> certificates, which has got delayed due to other work. 

ARMSL> Angus



  mailto:do...@yahoo.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2016-01-05 Thread Angus Robertson - Magenta Systems Ltd
> For people who want to understand how WebSocket protocol works I found
> a this very interesting and crystal clear article :
> 
> http://lucumr.pocoo.org/2012/9/24/websockets-101/

Thanks, I've got various reading about websockets, but no time to think about 
them,
although it is on the long term ICS wish list I published a while ago.  

I'm sure you can borrow some of the server side implementation for the client,
creating keys and frames will be very similar in client and server.  

My inclination would be client websockets should be a separate ICS component, a
descendent of THttpCli, overriding the necessary events, with only minor 
changes in
THttpCli, which is a stable component.  

We also need a test websockets web site, a quick Google suggests some echo test
sites (like http://www.websocket.org), but ideally there should be some pages 
on my
public IIS/8.5 server which seems to support websockets (at least it was an 
install
option). 

My priority this month is the ACME protocol to automate acquiring and 
installing SSL
certificates, which has got delayed due to other work. 

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2016-01-05 Thread Dod
Hello Angus,

For people who want to understand how WebSocket protocol works I found
a this very interesting and crystal clear article :

http://lucumr.pocoo.org/2012/9/24/websockets-101/

regards.

>> I am attempting THttpCli adding specific HTTTP Headers to see it works

ARMSL> There are THttpCli events for sent and received headers, into which you 
can add your
ARMSL> extra Upgrade:, etc, headers, and check if they are received.  

ARMSL> This should be easy enough for testing, once there is a list of the 
actual
ARMSL> headers used both ways, they could be added to the real component, but 
ideally we
ARMSL> need a server to test against. 

ARMSL> Not sure what happens after the upgrade handshake, presumably the 
traffic continues
ARMSL> on the same socket but bypassing the HTTP protocol.   That might be fun 
to
ARMSL> implement...

ARMSL> Angus




  mailto:do...@yahoo.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2016-01-04 Thread Dod
Hello,

First of all, happy new year to all ICS lovers ;-)

Well  I  think  I  said  victory  too  soon,  in  fact the socket stay
connected  but  no event is triggered by ICS, OnDataPush, OnDataPush2,
OnDocData,  OnDocBegin,  none  of  them triggers, sniffing the network
show data reception from websocket server.

The  stream  is  a  flow  of  JSON  stuctures  (each  block of JSON is
preceeded  by an 8 bytes binary block), there is no CRLF at all inside
JSON or between packs.

I  know  it's  difficult to answer that from an external point of view
but any idea why no event is triggered ?

regards.

>> I am attempting THttpCli adding specific HTTTP Headers to see it works

ARMSL> There are THttpCli events for sent and received headers, into which you 
can add your
ARMSL> extra Upgrade:, etc, headers, and check if they are received.  

ARMSL> This should be easy enough for testing, once there is a list of the 
actual
ARMSL> headers used both ways, they could be added to the real component, but 
ideally we
ARMSL> need a server to test against. 

ARMSL> Not sure what happens after the upgrade handshake, presumably the 
traffic continues
ARMSL> on the same socket but bypassing the HTTP protocol.   That might be fun 
to
ARMSL> implement...

ARMSL> Angus




  mailto:do...@yahoo.com

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2015-12-30 Thread Angus Robertson - Magenta Systems Ltd
> I am attempting THttpCli adding specific HTTTP Headers to see it works

There are THttpCli events for sent and received headers, into which you can add 
your
extra Upgrade:, etc, headers, and check if they are received.  

This should be easy enough for testing, once there is a list of the actual
headers used both ways, they could be added to the real component, but ideally 
we
need a server to test against. 

Not sure what happens after the upgrade handshake, presumably the traffic 
continues
on the same socket but bypassing the HTTP protocol.   That might be fun to
implement...

Angus


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2015-12-30 Thread Dod
Hello Angus,

Yes  I already googled around before asking and found this server side
source  code but found no client side inside it, the client example is
only .html web browser side.

I am attempting THttpCli adding specific HTTTP Headers to see it works
the  only  thing  is to keep THttCli opened for a long time to receive
the data and also being able to send data thru it time to time.

I  found also source code for Synapse and Indy but I am married to ICS
for years ;-)

regards.

Wednesday, December 30, 2015, 5:41:00 PM, you wrote:

>> Do somebody already used THttpCli as HTTP WebSocket client or should I
>> use more level TWSocket and handle all the HTTP protocol myself ?

ARMSL> Stan Korotky wrote an ICS Websockets server component back in 2012, 
which is
ARMSL> available from http://ics-websockets.googlecode.com/svn/trunk

ARMSL> But I'm not aware of anyone offering a Websockets client demo or 
component. A quick
ARMSL> search of this archive does not find any client information, just 
discussions back
ARMSL> in early 2012 about the above server implementation.   

ARMSL> Angus


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HTTPCLI for WebSocket connection ?

2015-12-30 Thread Angus Robertson - Magenta Systems Ltd
> Do somebody already used THttpCli as HTTP WebSocket client or should I
> use more level TWSocket and handle all the HTTP protocol myself ?

Stan Korotky wrote an ICS Websockets server component back in 2012, which is
available from http://ics-websockets.googlecode.com/svn/trunk

But I'm not aware of anyone offering a Websockets client demo or component. A 
quick
search of this archive does not find any client information, just discussions 
back
in early 2012 about the above server implementation.   

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] HTTPCLI for WebSocket connection ?

2015-12-30 Thread Dod
Hello,

Do somebody already used THttpCli as HTTP WebSocket client or should I
use more level TWSocket and handle all the HTTP protocol myself ?

regards.

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be