Derbyjs: how to connect to it with no-browser socket.io-client

274 Views Asked by At

step:

  1. start a derby app
  2. write a standalone node client app , set up socket.io-client , connect to derby's store's sockets

questions:

  1. the client is not run at browser, so it don't has session, can it pass Racer's socket authorization?

  2. how to write dery service that can listen message from client, then put it into derby store/model?

1

There are 1 best solutions below

0
On

You can fallback to ajax by having following in your /server/index.js

require('derby/node_modules/racer').io.set('transports', ['xhr-polling']);

Checkout example