package
0.0.0-20210805150241-449d0e09d70b
Repository: https://github.com/project-flogo/websocket.git
Documentation: pkg.go.dev

# README

WebSocket Proxy

The ws service type accepts a websocket connection and backend url. It establishes another websocket connection against supplied backend url and acts as a proxy between both connections. This service doesn't produce any outputs as it runs proxy instance in the background and returns immediately.

The service settings for the request are as follows:

NameTypeDescription
uristringBackend websocket uri to connect
maxConnectionsnumberMaximum allowed concurrent connections(default 5)

Available input for the request are as follows:

NameTypeDescription
wsconnectionconnection objectWebsocket connection object

A sample service definition is:

{
    "name": "ProxyWebSocketService",
    "description": "Web socket proxy service",
    "ref": "github.com/project-flogo/websocket/activity/wsproxy",
    "settings":{
        "uri": "ws://localhost:8080/ws",
        "maxConnections": 5
    }
}

An example step that invokes the above ProxyWebSocketService service using wsconnection is:

{
    "service": "ProxyWebSocketService",
    "input": {
        "wsconnection":"=$.payload.wsconnection"
    }
}

# Packages

No description provided by the author

# Functions

New create a new websocket proxy.

# Structs

Activity is an activity that is used to invoke a Web socket operation settings : {wsconnection, url, maxconnections}.
Input is the input into the websocket proxy.
Output is the output of the websocket proxy.
ProxyClient is proxy between client websocket connection and server websocket connection.
ProxyService holds ongoing ProxyClient instances.
ProxyServices holds multiple ProxyService instances.
Settings are the settings for the websocket proxy.
WSProxy is websocket proxy service.