code: function(config) {
        config.method = angular.uppercase(config.method || "WATCH");
  
        authLogger.log("$ws (pre-intercept)", config.url.toString());
        var serverRequest = function(config) {
          authLogger.log("$ws (post-intercept)", config.url.toString());
          var ws = new WebSocket(config.url, config.protocols);
          if (config.onclose)   { ws.onclose   = config.onclose;   }
          if (config.onmessage) { ws.onmessage = config.onmessage; }
          if (config.onopen)    { ws.onopen    = config.onopen;    }
          if (config.onerror)   { ws.onerror    = config.onerror;  }
          return ws;
        };
  
        // Apply interceptors to request config
        var chain = [serverRequest, undefined];
        var promise = $q.when(config);
        angular.forEach(_interceptors, function(interceptor) {
          if (interceptor.request || interceptor.requestError) {
            chain.unshift(interceptor.request, interceptor.requestError);
          }
          // TODO: figure out how to get interceptors to handle response errors from web sockets
          // if (interceptor.response || interceptor.responseError) {
          //   chain.push(interceptor.response, interceptor.responseError);
          // }
        });
        while (chain.length) {
          var thenFn = chain.shift();
          var rejectFn = chain.shift();
          promise = promise.then(thenFn, rejectFn);
        }
        return promise;
      }
docs: Implement $ws()