added parse push connection code

translated from php to javascript.. may not be entirely correct...