detect protocol before testing websocket conn
detect protocol before testing websocket conn

fixes #413

Browsers now throw the uncatchable security exception when a secure page attempts non-secure websocket connection.
This change detects the current page protocol and switches websocket protocol accordingly.

tanmaykm/JuliaBox,JuliaLang/JuliaBox,tanmaykm/JuliaBox,tanmaykm/JuliaBox,JuliaLang/JuliaBox,JuliaLang/JuliaBox,tanmaykm/JuliaBox,JuliaLang/JuliaBox