# websocket_actor A [syndicated actor](https://syndicate-lang.org/) for communicating JSON to websocket servers. The actor observes `{dataspace: #!any url: string }` assertions and connects to a websocket endpoint. During the lifetime of the connection a `` assertion is made. Messages recieved from the server are sent to the dataspace wrapped in `` records and messages observed as `` are sent to the server. Unfortunately this utility is only as useful and reasonable as the websocket server it is connected to. ## Example: ### Syndicate server configuration: ``` > let ?exported-dataspace = dataspace ?cap> [ $cap { dataspace: $exported-dataspace url: "ws://127.0.0.1:5225/" } ] $exported-dataspace #f> ``` ### Shell ``` # Use the "syndump" utility to log '' records from the background. syndump '' & # Use the "msg" utilite to send '' records. # The message command wraps its arguments in a record with a label set to argv[0]. cp $(which msg) send send '{ type: "command" body: { type: "body" text: "fuck off webdevs"} }' ```