use of const gives errors in IE9 on windows7

using const is definitely cleaner code but since the script is to do graceful fallback on older browsers without websockets it seems the right thing to downgrade to var.