package
0.0.0-20200821104852-f76c6d292a95
Repository: https://github.com/jvanderl/flogo-components.git
Documentation: pkg.go.dev

# README

WsServer

This trigger provides your flogo application the ability to start a flow when you receive a Websocket Message.

Installation

flogo install github.com/jvanderl/flogo-components/trigger/wsserver

Link for flogo web:

https://github.com/jvanderl/flogo-components/trigger/wsserver

Schema

Outputs and Endpoint:

{
  "settings": [
    {
      "name": "port",
      "type": "integer"
    }
  ],
  "output": [
    {
      "name": "message",
      "type": "string"
    },
    {
      "name": "channel",
      "type": "string"
    }
  ],
  "reply": [
    {
      "name": "response",
      "type": "string"
    }
  ],
  "handler": {
    "settings": [
        {
          "name": "channel",
          "type": "string"
        }
      ]
  }
}

Settings

SettingDescription
portThe port the built-in WebSocket Server is listening to

Ouputs

OutputDescription
messageThe message received by the trigger
channelThe channel the message is received on

Reply

NameDescription
responseThe response message returned to the WebSocket sender

Handler Settings

SettingDescription
channelThe channel messages can be received

Example Configuration

Trigger to run a flow when a message is receved on WS channel 'test'

{
  "name": "wsserver",
  "settings": {
  },
  "handlers": [
    {
      "actionId": "local://testFlow",
      "settings": {
        "channel": "/test",
      }
    }
  ]
}