Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mono-js/mono-io
Socket.io module for Mono
https://github.com/mono-js/mono-io
io mono mono-module socket socket-io
Last synced: about 1 month ago
JSON representation
Socket.io module for Mono
- Host: GitHub
- URL: https://github.com/mono-js/mono-io
- Owner: mono-js
- License: mit
- Created: 2017-09-26T10:56:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T23:15:23.000Z (over 6 years ago)
- Last Synced: 2024-11-15T03:20:08.726Z (about 2 months ago)
- Topics: io, mono, mono-module, socket, socket-io
- Language: JavaScript
- Homepage:
- Size: 204 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> Socket.io module for [Mono](https://github.com/terrajs/mono)
[![npm version](https://img.shields.io/npm/v/mono-io.svg)](https://www.npmjs.com/package/mono-io)
[![Travis](https://img.shields.io/travis/terrajs/mono-io/master.svg)](https://travis-ci.org/terrajs/mono-io)
[![Coverage](https://img.shields.io/codecov/c/github/terrajs/mono-io/master.svg)](https://codecov.io/gh/terrajs/mono-io.js)
[![license](https://img.shields.io/github/license/terrajs/mono-io.svg)](https://github.com/terrajs/mono-io/blob/master/LICENSE)Mono-io uses [socket.io](https://github.com/socketio/socket.io) and [socketio-jwt](https://github.com/auth0-community/socketio-jwt) to handle sockets with authorization via JWT.
## Installation
```bash
npm install --save mono-io
```Then, in your configuration file of your Mono application (example: `conf/application.js`):
```js
module.exports = {
mono: {
modules: ['mono-io']
}
}
```## Configuration
mono-io will use the `io` property of your configuration (example: `conf/development.js`):
```js
module.exports = {
mono: {
io: {
// See options here: https://github.com/socketio/socket.io/blob/master/docs/API.md#new-serverhttpserver-options
}
}
}
```## Usage
In your modules files, you can access `io` instance:
```js
const { io } = require('mono-io')io.on('connection', function (socket) {
console.log(socket)
})
```