/**
 * Central configuration
 * Mock mode is auto-detected: file:// = mock, http:// = live
 * Override with ?mock in the URL to force mock mode
 */

var Config = (function () {
    var mockMode = window.location.protocol === 'file:'
        || window.location.search.indexOf('mock') !== -1;

    return {
        MOCK_MODE: mockMode,

        WS_URL: 'ws://' + window.location.host + '/ws',
        API_URL: '/api',

        getWebSocketClass: function () {
            return this.MOCK_MODE ? MockWebSocket : WebSocket;
        }
    };
})();
