<< Click to Display Table of Contents >> Navigation: Actions > WebSockets > WS Connection Manager |
You can open WS Connection Manager via the plugin settings (menu Options->Settings->Plugins tab) or from the editor of WebSocket actions or WebSocket triggers.
Here you can define the required set of servers and clients. The editor is divided into two tabs, respectively:
•Servers
•Clients
Note: This feature is available for Business license only |
You can create a list of required WebSocket Servers and define required parameters for each server separately.
Active
Tick this checkbox if you want this server to be active when RoboTask is loaded and when parameters are saved.
General
Name
Server name. When selecting a server in the actions and triggers editor, you can specify any string for visualization.
Bindings
Binding to IP address and port. Binding to multiple IP addresses and ports is supported. The binding is specified in <IP_address>:<port> format
If you specify 0.0.0.0 as the address, the server will bind to all available computer addresses of the specified port.
If you specify local address of 127.0.0.1, the server will only accept local connections within the local computer
TLS
TLS (transport layer security) – traffic encryption mode.
If you access WS Server via the wide area network, it is recommended to use traffic encryption. To do this, you need to specify the certificate and the private key for encryption. You can use paid or free certificates (for example, here).
You can also create the so-called "self-signed" certificates. You can make self-signed certificates using OpenSSL or Powershell package. Read how to do it here or here
If you intend to use Websocket locally on your computer or in the office LAN, traffic encryption is not necessary.
If you specify that the server needs to encrypt traffic, you must also specify the encryption certificate and the private key of the certificate. These are text files in PEM format. They can have any extensions, but as a rule, PEM or CRT extensions are used for the certificate. PEM or KEY extensions are used for the key.
HTTP Server
Websocket server can act as a simple HTTP server.
Empty Response
A default option. WS Server sends an empty response to the HTTP request.
HTML page
WS Server returns the specified HTML page when it receives the HTTP request.
Serve files from folder
WS Server acts as a simple HTTP server built on static HTML pages, CSS files and image files
Specify Content folder and Default document
Authentication
Allows anonymous connections
If you enabled this option, no user rights check is carried out. The server accepts connections without authorization
HTTP basic authorization
Standard authorization using a username or password.
URL Authentication
This authorization method is mainly used in scripts. In this case, the username and password are passed via the query string:
wss://<host>:<port>/auth/<username>/<password>
When configuring WS Client in RoboTask, you need to specify the following string in the Parameters field
/auth/<username>/<password>
User rights
Defining a list of users for authorization
•System user accounts - In this case RoboTask uses system user authentication. When selecting this authorization mode, be sure to specify which system groups the user should belong to. It is necessary to specify one or several groups. If the user does not belong to any of the specified groups, the authorization will fail, even if the authorization parameters are correct. For example, you can create a system user group "RoboTask users" and open access for users of this group.
•Custom User list – in this case, you need to define the user as text. Every string should look like:
Username=Password
Advanced
ID
WS server ID. By default, WS_SERVER_N string, where N is a number (ordinal number), is assigned as the identifier.
The identifier must consist of letters, numbers and an underscore and must begin with a letter or an underscore. Other characters are not allowed.
The identifier is case insensitive.
When editing a network task you must know the WebSocket server ID and specify it explicitly, because you won't be able to choose the desired server from the list.
Here you can create a list of required WebSocket clients, and define required parameters for each Client separately.
Active
Tick this checkbox, if you want this client to be active when RoboTask is loaded and when parameters are saved.
Test connection
When clicking this button, the client settings are saved and an attempt is made to connect with the current client parameters. After the operation is complete, you will see a message about the result of the connection attempt.
Connection
General parameters of client connection
Name
The client name for visualization. Enter any name that is easy to understand.
Autofill from URL
This function allows to fill in the joining parameters automatically, if you know full URL of the Websocket server.
URL starts with ws:// or wss:// prefix
For example:
wss://myhost.com:12345/auth/user/psw
ws://myhost.com/report?info=common&date=20201201
Host
Websocket server name or IP address
Port
Websocket sercer port. By default, the ports used are the same as those of HTTP server:
•80 – without using TLS/SSL
•443 – when using TLS/SSL.
Use TLS
Tick this checkbox, if you want to use encryption. Please note that the encryption mode is determined by the WS server. If the client's encryption mode does not match the server setting, the client will not be able to connect.
Parameters
A string of the path and URL parameters. For example:
/auth/user/psw
/report?info=common&date=20201201
Authentication
HTTP Basic Authentication
Tick this checkbox, if you need basic authorization
Username
A user name.
Password
An explicit password.
Advanced
ID
WS Client ID. By default, WS_CLIENT_N string, where N is a number, is assigned as the identifier.
The identifier must consist of letters, numbers and an underscore and must begin with a letter or an underscore. Other characters are not allowed.
The identifier is case insensitive.
When editing a network task you must know the Websocket client ID and specify it explicitly, as you won't be able to choose the desired server from the list.
Ping server every X seconds to maintain connection alive
If you want to regularly check connectivity even without performing any action, then tick this checkbox. It is disabled by default.
Some applications with a built-in Websocket server can forcibly disconnect when there is no client's activity. In this case, ping will help keep the connection active.
Interval (ping)
Specify the check interval.
Auto reconnect to server if connection is lost
Tick this chechbox, if it is necessary to re-establish the lost connection. It is disabled by default.
Interval (reconnect)
Specify the interval of connection attempts
Related Topics
WebSocket Server HTTP Response
Connect/Disconnect WebSocket Client
WebSocket Server On HTTP Reqest