Module @mdf.js/socket-server-provider

@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

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

Using npm:

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

Using yarn:

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

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

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.
  • 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

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.

Namespaces

SocketIOServer