Protocol Session

Louis Charette edited this page Apr 19, 2014 · 1 revision

The CMD 'CONNECT' triggers on the server that the RAW's 'lOGIN' & 'IDENT' can be send. This is a Handshake.

Here is a session example:

Client 0 initiates a connection negotiation by sending a CONNECT command.:

POST /? HTTP/1.1
Host: 0.ape.ape-project.org

[{"cmd":"CONNECT","chl":0,"params":{"transport":0}}]

Server respond to client 0 :

[{"raw":"LOGIN","time":"1253633967","data":{"sessid":"4622c258248931a7dfb081542eaf589f"}}, {"raw":"IDENT","time":"1253633967","data":{"user":{"casttype":"uni","pubid":"5288a462f528d3609777f31872d31c8d"}}}]

Client 1 : (user opened a new window)

POST /? HTTP/1.1
Host: 1.ape.ape-project.org
 
[{"cmd":"CHECK","chl":1,"sessid":"4622c258248931a7dfb081542eaf589f"}]

Server respond to client 1 :

[{"raw":"LOGIN","time":"1253633967","data":{"sessid":"4622c258248931a7dfb081542eaf589f"}}, {"raw":"IDENT","time":"1253633967","data":{"user":{"casttype":"uni","pubid":"5288a462f528d3609777f31872d31c8d"}}}]

Client 1 : (user join a channel)

POST /? HTTP/1.1
Host: 1.ape.ape-project.org
 
[{"cmd":"JOIN","sessid":"4622c258248931a7dfb081542eaf589f","chl":1,"params":{"channels":["testChannel"]}}]

Server respond to client 0 and 1 :

{"raw":"CHANNEL","time":"1253640697","datas":{"pipe":{"properties":{"name":"testChannel"},"casttype":"multi","pubid":"2f50f03539dfe782e233d0a76205b3f3"},"users":[{"level":"1","casttype":"uni","pubid":"4622c258248931a7dfb081542eaf589f"}]}}