       }
     }
     
-    func leave(topic  topic: String, message: Phoenix.Message) {
-      let leavingMessage = Phoenix.Message(subject: "status", body: "leaving")
-      let payload = Phoenix.Payload(topic: topic, event: "leave", message: leavingMessage)
+    public func leave(topic  topic: String, message: Phoenix.Message) {
+      let payload = Phoenix.Payload(topic: topic, event: "phx_leave", message: message)
       send(payload)
       var newChannels: [Phoenix.Channel] = []
       for chan in channels {

      return json
    }
  }
}
    var heartbeatTimer: NSTimer?
    let heartbeatAfterSec = 30
    var messageReference: UInt64 = UInt64.min // 0 (max: 18,446,744,073,709,551,615)
    
    public init(domainAndPort:String, path:String, transport:String, prot:String = "http") {
      self.endPoint = Path.endpointWithProtocol(prot, domainAndPort: domainAndPort, path: path, transport: transport)
      super.init()
