 
     /* End Handlers */
 
-    init(profileName: String, host: String) {
-        //TODO: Change the scheme to WSS for production
-        socket = WebSocket(url: NSURL(scheme: "wss", host: "\(host)/socketcluster/", path: "/")!)
+    init(profileName: String, host: String, secure: Bool) {
+        
+        var scheme = "ws"
+        if secure {
+            scheme = "wss"
+        }
+        
+        socket = WebSocket(url: NSURL(scheme: scheme, host: "\(host)/socketcluster/", path: "/")!)
 
         self.profileName = profileName
 

    /* Private variables */
    private var cid = 1

    private var serverAuthToken: String?
    
    private var events = [Int:Event]()

    /* Internal variables */

import GCDTimer
import SwiftStore

internal protocol JSONDictConvertible {
    func toDict() -> Dictionary<String, AnyObject>?
}
