Test for WebSocket, default to HTTP.

This commit is contained in:
Michael Jumper
2012-03-09 12:42:56 -08:00
parent f9d6830ab5
commit 6a52434b12

View File

@@ -103,9 +103,13 @@
var tunnel;
// TODO: Detect WebSocket and websocket-tunnel
// If WebSocket available, try to use it.
if (window.WebSocket)
tunnel = new Guacamole.WebSocketTunnel("websocket-tunnel")
//tunnel = new Guacamole.HTTPTunnel("tunnel")
// If no WebSocket, then use HTTP.
else
tunnel = new Guacamole.HTTPTunnel("tunnel")
// Instantiate client
var guac = new Guacamole.Client(tunnel);