fixed GET to be path instead of full url
added port to Host: and Origin: headers
check Content-type case insensitively
use AtomicBoolean really atomically for reconnecting
emit onConnect event also when reconnecting after error
call onClosed only if it was successfully opened (and onConnect was called previously)