Examples
Hello World (Blueprint)
Sending a payload defined in Unreal is easy with WebSock, here's how:
1. Define your payload
Inside Unreal Editor, right-click to access the 'create asset' menu and make a new user-defined structure.

You could also use a pre-existing structure defined in C++ or Blueprints

The Blueprint defined structure used for the rest of this example
2. SendMessage via WebSockSystem
To send our structure we can simply serialise it to JSON using WebSockLib, which serialises a wildcard (any) struct input - returning an FString suitable for transport to a connection managed by WebSockSystem.

Grabbing WebSockSystem and creating a New Socket to send MyStruct