CloudHub

    • Get message context and create ChannelQ for events
    • Create http connection over websocket
    • Read message from edge
    • Write message to edge
    • Publish message to Controller
    • TLS certificates are loaded through the path provided in the context object
    • HTTP server is started with TLS configurations
    • Then HTTP connection is upgraded to websocket connection receiving conn object.
    • ServeConn function the serves all the incoming connections
    • First a deadline is set for keepalive interval
    • Then the JSON message from connection is read
    • Message is then converted to event object for cloud internal communication
    • In the end the event is published to EdgeController
    • First all event objects are received for the given nodeID
    • The existence of same request and the liveness of the node is checked
    • The event object is converted to message structure
    • Write deadline is set. Then the message is passed to the websocket connection
    • A default message with timestamp, clientID and event type is sent to controllerevery time a request is made to websocket connection
    • If the node gets disconnected then error is thrown and an event describingnode failure is published to the controller.

    Usage

    • Start the websocket server only: Click to see the details.
    • Start the websocket and quic server at the same time: Click here to see the details