mirror of
https://github.com/novnc/noVNC.git
synced 2026-06-02 18:39:41 +00:00
Add web-socket-js debug flag and default to off.
This commit is contained in:
@@ -21,6 +21,7 @@ public class WebSocketMain extends Sprite {
|
||||
|
||||
private var policyLoaded:Boolean = false;
|
||||
private var callerUrl:String;
|
||||
private var debug:Boolean = false;
|
||||
|
||||
public function WebSocketMain() {
|
||||
|
||||
@@ -42,6 +43,10 @@ public class WebSocketMain extends Sprite {
|
||||
callerUrl = url;
|
||||
}
|
||||
|
||||
public function setDebug(val:Boolean):void {
|
||||
debug = val;
|
||||
}
|
||||
|
||||
public function create(
|
||||
url:String, protocol:String,
|
||||
proxyHost:String = null, proxyPort:int = 0,
|
||||
@@ -70,7 +75,9 @@ public class WebSocketMain extends Sprite {
|
||||
}
|
||||
|
||||
public function log(message:String):void {
|
||||
ExternalInterface.call("webSocketLog", encodeURIComponent("[WebSocket] " + message));
|
||||
if (debug) {
|
||||
ExternalInterface.call("webSocketLog", encodeURIComponent("[WebSocket] " + message));
|
||||
}
|
||||
}
|
||||
|
||||
public function error(message:String):void {
|
||||
|
||||
Reference in New Issue
Block a user