Skip to content

jennifer-ross/fastify-wsapix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastify-wsapix

npm version

WebSocket support for Fastify built on the wsapix library.

Install

npm install fastify-wsapix --save

Support TypeScript

Usage

import Fastify from 'fastify'
import fastifyWsapix from 'fastify-wsapix'

const app = Fastify({
    log: true,
})

app.register(fastifyWsapix, {
    engine: 'ws' // can be only 'ws' or 'uWS', default is 'ws'
})

app.listen(3000, err => {
    if (err) {
        app.log.error(err)
        process.exit(1)
    }
})

app.wsapix.on('connect', (client) => {
    console.log('Client connected.')
    client.send('Hellow from server!') // Creates an echo server
})

Notes

Wsapix it is next generation Websocket framework for nodejs

Provides to you:

  • Channel/message approach for websocket API
  • uWebsockets.js engine support
  • Middlewares and hooks support
  • Custom schema parser/serializer support
  • Message paylaod validation
  • AsyncAPI specification generation
  • Mock server with websocket client injection
  • Typescript syntax support out of the box

License

Licensed under MIT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published