only send hearbeat packets to websockets
update the headers that are sent on a long poll
move header into different function and call json.Marshal on the message
updated the js to start with long poll then upgrade to socket if it can connect