feathersjs/canjs-feathers — pull request #8 by marshallswain (2014-07-08 00:27:46+00:00)
Title: Removed script auto-load.  Added can.Feathers.disconnect().

This stops canjs-feathers from automatically loading the socket library script, thus making it necessary to have a previous, separate socket.io script before loading canjs-feathers.

I'd like to be able to disconnect the socket and reconnect it with an auth token upon login. So this...

```js
can.Feathers.connect('', {transports: ['websocket', 'xhr-polling'] });
```

is later followed, upon login, by this:
```js
can.Feathers.disconnect();
can.Feathers.connect('', {query: 'token=' + localStorage.getItem('featherstoken'), transports: ['websocket', 'xhr-polling'] });

```
I added a couple of lines to give access to socket.disconnect() by way of can.Feathers.disconnect(). It does the job, but quite permanently. It will take some more work to make it possible to reconnect the socket once disconnected.