Namespace: MIGChat

MIGChat

MIG Chat Application - client-side chat implementation

Properties:
Name Type Description
Config object

Configuration constants

DOM object

DOM element references

State object

Application state management

mockServer object

Mock server implementation

mockWs object

Mock WebSocket connection

messageHandlers object

Message type handlers

commands object

Chat command registry

CoreFunctions object

Core application functions

UIRendering object

UI rendering functions

UserFeedback object

User notification system

CommandHandlers object

Command handlers

ConnectionManager object

Connection management

EventHandlers object

User interaction handlers

Source:

Namespaces

CommandHandlers

Command handlers for chat operations

.
Config

Core configuration constants

.
ConnectionManager

WebSocket connection management utilities

.
CoreFunctions

Core application functionality including command processing and validation

.
DOM

DOM element references

.
EventHandlers

Global event handlers for user interactions

.
MessageHandlers

Message handlers for different WebSocket message types

.
State

Application state management

.
UIRendering

User Interface rendering and update functions

.
UserFeedback

User feedback and notification system

.
WebSocketHandlers

WebSocket event handlers and message processing

.
commands

Command registry for chat application (case-independent)

.
mockServer

Mock server implementation

.
mockWs

Handles all WebSocket communication patterns including:

Connection Flow:

  1. Connect Sequence:
    • Client -> connect
    • Server -> connect_ack
    • On failure: Server -> connect_error

Normal Quit Flow:

  1. Client -> quit
  2. Server -> quit_ack
  3. Server -> close(1000)
  4. Client(onclose)

Error Cases:

  • Command Errors (server rejects):
    • connect_error: Invalid username
    • quit_error: User not connected
  • Connection Errors:
    • onclose: codes 1001-1015 (network issues)
    • system_error: internal server errors

Standard Close Codes:

  • 1000: Normal closure
  • 1001: Going away
  • 1006: Abnormal closure
  • 4000-4999: Application-specific codes
.