Documentation ¶
Overview ¶
package main simulates a conversation between a given set of websocket clients and a server.
It spins up a web socket server. On a client's connection it creates a SenderReceiver which handles JSON Stream encoding and decoding using gojay's streaming API to abstract JSON communication between server and client, only having to handle go values.
To simulate a conversation: - the server sends a welcome message to the client - when the client receives the message, it sends a message back to the server - when the server receives the ack message, it will send a message randomly to a client - when the client receives the message, it sends a message back to the server... and so on.
Click to show internal directories.
Click to hide internal directories.