Skip to content

Commit

Permalink
Added some documentation to the browserchannel server
Browse files Browse the repository at this point in the history
  • Loading branch information
josephg committed Nov 2, 2011
1 parent 81536de commit b6ef089
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion src/server/browserchannel.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# This implements the network API for ShareJS thats not broken.
#
# This uses an updated version of the socket.io protocol
# This uses an updated version of the socket.io protocol.
#
# When a client connects the server first authenticates the client and sends it:
#
# S: {auth:<client id>}
# or
# S: {auth:null, error:'forbidden'}
#
# After that, the client can open documents:
#
# C: {doc:'foo', open:true, snapshot:null, create:true, type:'text'}
# S: {doc:'foo', open:true, snapshot:{snapshot:'hi there', v:5, meta:{}}, create:false}
#
# ...
#
# The client can send open requests as soon as the socket has opened - it doesn't need to
# wait for auth.
#
# The wire protocol is documented here:
# https://github.com/josephg/ShareJS/wiki/Wire-Protocol

browserChannel = require('browserchannel').server
util = require 'util'
Expand Down
2 changes: 1 addition & 1 deletion test/socketio.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ module.exports = testCase
test.expect 7
test.done()

'Cannot open a document if you cannot listen': (test) ->
'Cannot open a document if auth rejects you': (test) ->
@auth = (client, action) =>
if action.name == 'open'
action.reject()
Expand Down

0 comments on commit b6ef089

Please sign in to comment.