Thumbnail

Websocket Server

by Synthiam

A WebSocket server for ARC that accepts client connections and executes scripts for each message received.

Requires ARC v3 (Updated 4/2/2021)

How to add the Websocket Server robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Communication category tab.
  5. Press the Websocket Server icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Websocket Server robot skill.

How to use the Websocket Server robot skill

A WebSocket server for ARC that accepts client connections and executes scripts for each message received. The received message contents will be stored in the respective variable.

User-inserted image

Configuration Menu

User-inserted image

  1. The Response Variable will hold the text response message that is sent from the client.

  2. Response Script will be executed for every response that is sent from the clients. Within this script, the response message is available in the Response Variable. By default, an example script will speak the response data.

  3. The Connection Status Variable holds a true or false bool regarding the status of the server if listening.

  4. Enable Debug will display the full response message in the log window. This will consume unnecessary CPU and memory in a production environment and is only for debugging. By default, this is checked.

Run As Administrator

*Note: Due to security restrictions in Windows, ARC will have to be run as administrator for this robot skill.

Optionally, Microsoft Windows can have the access control list altered to avoid the need to run as administrator. You may have to add URL ACLs, i.e. URL bindings, within the operating system using the netsh command:

  • Check for existing bindings using: netsh http show urlacl
  • Add a binding using: netsh http add urlacl url=http://[hostname]:[port]/ user=everyone listen=yes (Where hostname and port are the values you are using in the constructor)

ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

PRO
Synthiam
#1   — Edited

Bugfix when a message is received while ARC is closing