Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@feathersjs/socketio

Package Overview
Dependencies
Maintainers
4
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feathersjs/socketio

The Feathers Socket.io real-time API provider

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.7K
decreased by-56.85%
Maintainers
4
Weekly downloads
 
Created
Source

@feathersjs/socketio

Greenkeeper badge

Build Status Test Coverage Dependency Status Download Status

The Feathers Socket.io real-time API provider

About

This provider exposes Feathers services through a Socket.io real-time API. It is compatible with Feathers 1.x and 2.x.

Note: For the full API documentation go to https://docs.feathersjs.com/api/socketio.html.

Quick example

import feathers from '@feathersjs/feathers';
import socketio from '@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);
      });
    });

    io.use(function(socket, next) {
      socket.feathers.data = 'Hello world';
      next();
    });

    io.use(function (socket, next) {
      // Authorize using the /users service
      app.service('users').find({
        username: socket.request.username,
        password: socket.request.password
      }, next);
    });
  }));

app.use('/todos', {
  get: function(id, params) {
    console.log(params.data); // -> 'Hello world'

    return Promise.resolve({
      id,
      description: `You have to do ${name}!`
    });
  }
});

Client use

import io from 'socket.io-client';
import feathers from 'feathers/client';
import socketio from '@feathersjs/socketio/client';

const socket = io('http://path/to/api');
const app = feathers()
  .configure(socketio(socket));

License

Copyright (c) 2015

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 01 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc