@feathersjs/socketio
Advanced tools
Comparing version 3.0.1 to 3.0.2
# Change Log | ||
## [v3.0.1](https://github.com/feathersjs/socketio/tree/v3.0.1) (2017-11-16) | ||
[Full Changelog](https://github.com/feathersjs/socketio/compare/v3.0.0...v3.0.1) | ||
**Closed issues:** | ||
- Remote address IP is always undefined [\#96](https://github.com/feathersjs/socketio/issues/96) | ||
**Merged pull requests:** | ||
- Add default export for better ES module \(TypeScript\) compatibility [\#100](https://github.com/feathersjs/socketio/pull/100) ([daffl](https://github.com/daffl)) | ||
- Updating client use example to fix imports [\#99](https://github.com/feathersjs/socketio/pull/99) ([corymsmith](https://github.com/corymsmith)) | ||
## [v3.0.0](https://github.com/feathersjs/socketio/tree/v3.0.0) (2017-11-01) | ||
@@ -4,0 +16,0 @@ [Full Changelog](https://github.com/feathersjs/socketio/compare/v2.0.1...v3.0.0) |
{ | ||
"name": "@feathersjs/socketio", | ||
"description": "The Feathers Socket.io real-time API provider", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"homepage": "https://github.com/feathersjs/socketio", | ||
@@ -58,3 +58,3 @@ "main": "lib/", | ||
"feathers": "^2.2.3", | ||
"feathers-memory": "^1.0.0", | ||
"feathers-memory": "^2.0.0", | ||
"istanbul": "^1.1.0-alpha.1", | ||
@@ -64,3 +64,3 @@ "lodash": "^4.0.1", | ||
"request": "^2.69.0", | ||
"semistandard": "^11.0.0", | ||
"semistandard": "^12.0.0", | ||
"socket.io-client": "^2.0.0", | ||
@@ -67,0 +67,0 @@ "uberproto": "^1.2.0" |
@@ -12,53 +12,29 @@ # @feathersjs/socketio | ||
## About | ||
## Installation | ||
This provider exposes [Feathers](http://feathersjs.com) services through a [Socket.io](http://socket.io/) real-time API. It is compatible with Feathers 1.x and 2.x. | ||
``` | ||
npm install @feathersjs/socketio --save | ||
``` | ||
__Note:__ For the full API documentation go to [https://docs.feathersjs.com/api/socketio.html](https://docs.feathersjs.com/api/socketio.html). | ||
## Quick example | ||
```js | ||
import feathers from '@feathersjs/feathers'; | ||
import socketio from '@feathersjs/socketio'; | ||
const feathers = require('@feathersjs/feathers'); | ||
const socketio = require('@feathersjs/socketio'); | ||
const app = feathers() | ||
.configure(socketio(function(io) { | ||
io.on('connection', function(socket) { | ||
socket.emit('news', { hello: 'world' }); | ||
socket.on('my other event', function (data) { | ||
console.log(data); | ||
}); | ||
}); | ||
const app = feathers(); | ||
io.use(function(socket, next) { | ||
socket.feathers.data = 'Hello world'; | ||
next(); | ||
}); | ||
app.configure(socketio()); | ||
io.use(function (socket, next) { | ||
// Authorize using the /users service | ||
app.service('users').find({ | ||
username: socket.request.username, | ||
password: socket.request.password | ||
}, next); | ||
}); | ||
})); | ||
app.listen(3030); | ||
``` | ||
app.use('/todos', { | ||
get: function(id, params) { | ||
console.log(params.data); // -> 'Hello world' | ||
## Documentation | ||
return Promise.resolve({ | ||
id, | ||
description: `You have to do ${name}!` | ||
}); | ||
} | ||
}); | ||
``` | ||
Please refer to the [@feathersjs/socketio documentation](https://docs.feathersjs.com/api/socketio.html) for more details. | ||
## License | ||
Copyright (c) 2015 | ||
Copyright (c) 2018 | ||
Licensed under the [MIT license](LICENSE). |
22953
7
40