@mdf.js/socket-server-provider
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

@mdf.js/socket-server-provider

Node Version Typescript Version Known Vulnerabilities Documentation

netin

Mytra Development Framework - @mdf.js/socket-server-provider

Typescript tools for development

Table of contents

Introduction

Socket server provider for @mdf.js based on socket.io.

Installation

Using npm:

npm install @mdf.js/socket-server-provider

Using yarn:

yarn add @mdf.js/socket-server-provider

Information

Check information about @mdf.js providers in the documentation of the core module @mdf.js/core.

Use

Checks included in the provider:

  • status: Check the status of the server based in the status of the listening port and the error events from the socket-io server.
    • observedValue: actual state of the consumer/producer provider instance [error, running, stopped] based in the last ping event. stopped if the provider is stopped or has not been initialized yet, running if the provider is running and the server is listening and error if the provider is running but the server is not listening.
    • status: pass if the status is running, warn if the status is stopped, fail if the status is error.

Environment variables

  • CONFIG_SOCKET_IO_SERVER_PORT (default: 8080): Port where the server will listen
  • CONFIG_SOCKET_IO_SERVER_HOST (default: 'localhost'): Host where the server will listen
  • CONFIG_SOCKET_IO_SERVER_PATH (default: '/socket.io'): Path where the server will listen
  • CONFIG_SOCKET_IO_SERVER_ENABLE_UI (default: true): Enable the UI
  • CONFIG_SOCKET_IO_SERVER_CORS__ORIGIN (default: `/[\s\S]*\/`): CORS origin
  • CONFIG_SOCKET_IO_SERVER_CORS__CREDENTIALS (default: true): CORS credentials

License

Copyright 2024 Mytra Control S.L. All rights reserved.

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

Package Sidebar

Install

npm i @mdf.js/socket-server-provider

Weekly Downloads

249

Version

1.6.0

License

MIT

Unpacked Size

42.9 kB

Total Files

59

Last publish

Collaborators

  • cjimenezsaiz