Source

gevent_cometd /

Filename Size Date modified Message
gevent_cometd
122 B
1.5 KB
1.4 KB
605 B

gevent_cometd

usage:

Open your browser and point it to following url:

http://localhost:8088/static/demo.html

http://localhost:8088/ - this url will send out random message

Data format and endpoints

/connect?secret=YOURSECRET

expects a json request in form of:

{ "user": YOUR_USER_NAME, "channels": [ "CHAN_NAME1", "CHAN_NAMEX" ] }

where channels is a list of channels this connection/user is subscribed to

/message?secret=YOURSECRET

expects a json request in form of:

{ "channel": "CHAN_NAME", "user": "NAME_OF_POSTER", "message": MSG_PAYLOAD }

/subscribe?secret=YOURSECRET

expects a json request in form of:

{ "channels": [ "CHAN_NAME1", "CHAN_NAMEX" ], "conn_id": "CONNECTION_ID"}

Responses to js client

Responses to client are in form of list containing objects:

examples:

new message

{
"date": "2011-09-15T11:36:18.471862",
"message": MSG_PAYLOAD,
"type": "message",
"user": "NAME_OF_POSTER",
"channel": "CHAN_NAME"
}

presence info

{
"date": "2011-09-15T11:43:47.434905",
"message": null,
"type": "join",
"user": "NAME_OF_POSTER",
"channel": "CHAN_NAME"
}

Installation and Setup

Obtain source from github and do:

python setup.py develop
gevent_cometd