code: def publish_to_socket(params)
        message = params.is_a?(String) ? params : params.to_json
        data = "~m~#{message.length}~m~#{message}"
        @socket.send(data)
      end
docs: Publishes the given params to the web socket