josephg / ShareJS

Collaborative editing in any app
Other
4.97k stars 454 forks source link

this.stream.read() is undefined #383

Open mib32 opened 9 years ago

mib32 commented 9 years ago

When i pass my stream object to shareJS, it throws error. But i'm totally sure that it is normal stream. Streams just don't have read() method

This is example using faye-websocket implementation

http   = require 'http'
share  = require 'share'
WebSocket   = require 'faye-websocket'

server = http.createServer()
server.on 'upgrade', (request, socket, body) ->
  if WebSocket.isWebSocket(request)
    ws = new WebSocket(request, socket, body)
    shareClient = share.server.createClient(backend: backend)
    shareClient.listen(ws.pipe(ws))

I also try to pass in stream from SockJS, having the same error.