├── README.md ├── manual ├── ModuleLand PRVE WHMCS Module Installation guide.pdf └── ModuleLand PRVE WHMCS Module usage guide.pdf └── modules ├── addons └── prve │ ├── Ipv4 │ ├── Address.php │ ├── Subnet.php │ └── SubnetIterator.php │ ├── db.sql │ ├── hooks.php │ ├── img │ ├── kvm.png │ └── openvz.png │ ├── proxmox.php │ └── prve.php └── servers └── prve ├── VncViewer.jar ├── clientarea.tpl ├── img ├── lxc.png ├── novnc.png ├── online.png ├── os │ ├── centos.png │ ├── debian.png │ ├── ubuntu.png │ ├── w2k.png │ ├── w2k3.png │ ├── w2k8.png │ ├── win7.png │ ├── wvista.png │ └── wxp.png ├── qemu.png ├── running.png ├── stopped.png ├── suspended.png └── tigervnc.png ├── js └── CircularLoader.js ├── novnc ├── images │ ├── alt.png │ ├── clipboard.png │ ├── connect.png │ ├── ctrl.png │ ├── ctrlaltdel.png │ ├── disconnect.png │ ├── drag.png │ ├── esc.png │ ├── favicon.ico │ ├── favicon.png │ ├── fullscreen.png │ ├── keyboard.png │ ├── mouse_left.png │ ├── mouse_middle.png │ ├── mouse_none.png │ ├── mouse_right.png │ ├── power.png │ ├── screen_320x460.png │ ├── screen_57x57.png │ ├── screen_700x700.png │ ├── settings.png │ ├── showextrakeys.png │ └── tab.png ├── include │ ├── Orbitron700.ttf │ ├── Orbitron700.woff │ ├── base.css │ ├── base64.js │ ├── black.css │ ├── blue.css │ ├── chrome-app │ │ └── tcp-client.js │ ├── des.js │ ├── display.js │ ├── inflator.js │ ├── input.js │ ├── jsunzip.js │ ├── keyboard.js │ ├── keysym.js │ ├── keysymdef.js │ ├── logo.js │ ├── playback.js │ ├── rfb.js │ ├── ui.js │ ├── util.js │ ├── web-socket-js │ │ ├── README.txt │ │ ├── WebSocketMain.swf │ │ ├── swfobject.js │ │ └── web_socket.js │ ├── websock.js │ └── webutil.js └── novnc_pve.php ├── prve.php └── tigervnc.php /README.md: -------------------------------------------------------------------------------- 1 | # PRVE 2 | 3 | I wrote this module for WHMCS at Feb 2016 and I tried to sell it via moduleland.com, But didn't sell at least one copy! 4 | 5 | So i decided to publish it (which i worked on it about 2 months) open-source. 6 | 7 | This is a PROXMOX VE module for WHMCS 6.x 8 | 9 | You can see guides to install in manual folder. I did disable the license section and there's no need to obtain any license. So you can ignore license part in the manual. 10 | -------------------------------------------------------------------------------- /manual/ModuleLand PRVE WHMCS Module Installation guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/manual/ModuleLand PRVE WHMCS Module Installation guide.pdf -------------------------------------------------------------------------------- /manual/ModuleLand PRVE WHMCS Module usage guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/manual/ModuleLand PRVE WHMCS Module usage guide.pdf -------------------------------------------------------------------------------- /modules/addons/prve/Ipv4/Address.php: -------------------------------------------------------------------------------- 1 | ip_long); 57 | } 58 | 59 | /** 60 | * toLong 61 | * Returns value as decimal (long) address 62 | * 63 | * @access public 64 | * @return real 65 | */ 66 | public function toLong() { 67 | return $this->ip_long; 68 | } 69 | 70 | /** 71 | * toBinary 72 | * Returns binary representation of address 73 | * 74 | * @access public 75 | * @return string 76 | */ 77 | public function toBinary() { 78 | return str_pad(decbin($this->ip_long),32,0,STR_PAD_LEFT); 79 | } 80 | 81 | /** 82 | * __toString 83 | * Magic method returns dotted quad IP address 84 | * 85 | * @access public 86 | * @return string 87 | */ 88 | public function __toString() { 89 | return $this->toString(); 90 | } 91 | 92 | /** 93 | * __construct 94 | * Private constructor 95 | * 96 | * @param real $long 97 | * @access private 98 | * @return void 99 | */ 100 | private function __construct($long) { 101 | $this->ip_long = $long; 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /modules/addons/prve/Ipv4/Subnet.php: -------------------------------------------------------------------------------- 1 | toString(); 52 | if ($s instanceof Ipv4_Address) $s = $s->toString(); 53 | if (is_string($n) and !$s) $this->setFromString($n); 54 | elseif ($n and $s) $this->setNetwork($n)->setNetmask($s); 55 | } 56 | 57 | /** 58 | * fromString 59 | * Primarily for chaining and consistency 60 | * 61 | * @param mixed $data 62 | * @static 63 | * @access public 64 | * @return Ipv4_Subnet 65 | */ 66 | static function fromString($data) { 67 | return new Ipv4_Subnet($data); 68 | } 69 | 70 | /** 71 | * CIDRtoIP 72 | * Static method converts CIDR to dotted-quad IP notation 73 | * 74 | * @param int $cidr 75 | * @static 76 | * @access public 77 | * @return string 78 | */ 79 | static function CIDRtoIP($cidr) { 80 | if (!($cidr >= 0 and $cidr <= 32)) 81 | throw new Exception(self::ERROR_CIDR_FORMAT); 82 | 83 | return long2ip(bindec(str_pad(str_pad('', $cidr, '1'), 32, '0'))); 84 | } 85 | 86 | /** 87 | * ContainsAddress 88 | * Static method to determine if an IP is on a subnet 89 | * 90 | * @param mixed $sn 91 | * @param mixed $ip 92 | * @static 93 | * @access public 94 | * @return bool 95 | */ 96 | static function ContainsAddress($sn,$ip) { 97 | if (is_string($sn)) $sn = Ipv4_Subnet::fromString($sn); 98 | if (is_string($ip)) $ip = Ipv4_Address::fromString($ip); 99 | if (!$sn instanceof Ipv4_Subnet) throw new Exception(self::ERROR_SUBNET_FORMAT); 100 | if (!$ip instanceof Ipv4_Address) throw new Exception(Ipv4_Address::ERROR_ADDR_FORMAT); 101 | $sn_dec = ip2long($sn->getNetmask()); 102 | 103 | return (($ip->toLong() & $sn_dec) == (ip2long($sn->getNetwork()) & $sn_dec)); 104 | } 105 | 106 | /** 107 | * setFromString 108 | * Parse subnet string 109 | * 110 | * @param string $data 111 | * @access public 112 | * @return self 113 | */ 114 | public function setFromString($data) { 115 | // Validate that the input matches an expected pattern 116 | if (!preg_match('!^([0-9]{1,3}\.){3}[0-9]{1,3}(( ([0-9]{1,3}\.){3}[0-9]{1,3})|(/[0-9]{1,2}))$!',$data)) 117 | throw new Exception(self::ERROR_NETWORK_FORMAT); 118 | 119 | // Parse one of two formats possible, first is /CIDR format 120 | if (strpos($data,'/')) { 121 | list($network,$cidr) = explode('/',$data,2); 122 | 123 | $this->setNetwork($network); 124 | $this->sn = ip2long(self::CIDRtoIP($cidr)); 125 | } 126 | // Second format is network space subnet 127 | else { 128 | list($network,$subnet) = explode(' ',$data,2); 129 | $this->setNetwork($network); 130 | $this->setNetmask($subnet); 131 | } 132 | 133 | return $this; 134 | } 135 | 136 | /** 137 | * contains 138 | * Method to check if an IP is on this network 139 | * 140 | * @param mixed $ip 141 | * @access public 142 | * @return bool 143 | */ 144 | public function contains($ip) { 145 | return self::ContainsAddress($this,$ip); 146 | } 147 | 148 | /** 149 | * setNetwork 150 | * Sets the network on the object, from dotted-quad notation 151 | * 152 | * @param string $data 153 | * @access public 154 | * @return self 155 | */ 156 | public function setNetwork($data) { 157 | $this->nw = Ipv4_Address::fromString($data)->toLong(); 158 | return $this; 159 | } 160 | 161 | /** 162 | * setNetmask 163 | * Sets the netmask on the object, from dotted-quad notation 164 | * 165 | * @param string $data 166 | * @access public 167 | * @return self 168 | */ 169 | public function setNetmask($data) { 170 | $data = Ipv4_Address::fromString($data); 171 | 172 | if (!preg_match('/^1*0*$/',$data->toBinary())) 173 | throw new Exception(self::ERROR_SUBNET_FORMAT); 174 | 175 | $this->sn = $data->toLong(); 176 | return $this; 177 | } 178 | 179 | /** 180 | * getNetmask 181 | * Returns the netmask as dotted-quad string 182 | * 183 | * @access public 184 | * @return string 185 | */ 186 | public function getNetmask() { 187 | return long2ip($this->sn); 188 | } 189 | 190 | /** 191 | * getNetmaskCidr 192 | * Returns the CIDR value representing the netmask 193 | * 194 | * @access public 195 | * @return int 196 | */ 197 | public function getNetmaskCidr() { 198 | return strlen(rtrim(decbin($this->sn),'0')); 199 | } 200 | 201 | /** 202 | * getNetwork 203 | * Returns the network address in dotted-quad notation 204 | * 205 | * @access public 206 | * @return string 207 | */ 208 | public function getNetwork() { 209 | $nw_bin = Ipv4_Address::fromLong($this->nw)->toBinary(); 210 | $nw_bin = (str_pad(substr($nw_bin,0,$this->getNetmaskCidr()),32,0)); 211 | return Ipv4_Address::fromBinary($nw_bin)->toString(); 212 | } 213 | 214 | /** 215 | * getFirstHostAddr 216 | * Returns the first address of this network 217 | * 218 | * @access public 219 | * @return string 220 | */ 221 | public function getFirstHostAddr() { 222 | $bin_net = Ipv4_Address::fromString($this->getNetwork())->toBinary(); 223 | $bin_first = (str_pad(substr($bin_net,0,31),32,1)); 224 | return Ipv4_Address::fromBinary($bin_first)->toString(); 225 | } 226 | 227 | /** 228 | * getLastHostAddr 229 | * Returns last host of this network 230 | * 231 | * @access public 232 | * @return string 233 | */ 234 | public function getLastHostAddr() { 235 | $bin_bcast = Ipv4_Address::fromString($this->getBroadcastAddr())->toBinary(); 236 | $bin_last = (str_pad(substr($bin_bcast,0,31),32,0)); 237 | return Ipv4_Address::fromBinary($bin_last)->toString(); 238 | } 239 | 240 | /** 241 | * getBroadcastAddr 242 | * Returns the broadcast address for this network 243 | * 244 | * @access public 245 | * @return string 246 | */ 247 | public function getBroadcastAddr() { 248 | $bin_host = Ipv4_Address::fromLong($this->nw)->toBinary(); 249 | $bin_bcast = str_pad(substr($bin_host,0,$this->getNetmaskCidr()),32,1); 250 | return Ipv4_Address::fromBinary($bin_bcast)->toString(); 251 | } 252 | 253 | /** 254 | * getTotalHosts 255 | * Returns a count of the total number of hosts on this network 256 | * 257 | * @access public 258 | * @return int 259 | */ 260 | public function getTotalHosts() { 261 | return (bindec(str_pad('',(32-$this->getNetmaskCidr()),1)) - 1); 262 | } 263 | 264 | /** 265 | * getIterator 266 | * Returns an iterator for addresses in this subnet 267 | * 268 | * @access public 269 | * @return Ipv4_SubnetIterator 270 | */ 271 | public function getIterator() { 272 | 273 | if (!class_exists('Ipv4_SubnetIterator')) 274 | require_once(dirname(__FILE__).'/SubnetIterator.php'); 275 | 276 | return new Ipv4_SubnetIterator($this); 277 | } 278 | 279 | /** 280 | * __toString 281 | * Magic method prints subnet in IP/cidr format 282 | * 283 | * @access public 284 | * @return string 285 | */ 286 | public function __toString() { 287 | return sprintf( 288 | '%s/%s', 289 | $this->getNetwork(), 290 | $this->getNetmaskCidr() 291 | ); 292 | } 293 | 294 | /** 295 | * count 296 | * Implements Countable interface 297 | * 298 | * @access public 299 | * @return void 300 | */ 301 | public function count() { 302 | return $this->getTotalHosts(); 303 | } 304 | } 305 | -------------------------------------------------------------------------------- /modules/addons/prve/Ipv4/SubnetIterator.php: -------------------------------------------------------------------------------- 1 | low_dec = ip2long($subnet->getFirstHostAddr()); 22 | $this->hi_dec = ip2long($subnet->getLastHostAddr()); 23 | } 24 | 25 | function rewind() { 26 | $this->position = 0; 27 | } 28 | 29 | function current() { 30 | return long2ip($this->low_dec + $this->position); 31 | } 32 | 33 | function key() { 34 | return $this->position; 35 | } 36 | 37 | function next() { 38 | ++$this->position; 39 | } 40 | 41 | function valid() { 42 | return (($this->low_dec + $this->position) <= $this->hi_dec); 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /modules/addons/prve/db.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `mod_prve` ( 2 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 3 | `license` text NOT NULL, 4 | `localkey` text, 5 | PRIMARY KEY (`id`) 6 | ); 7 | INSERT INTO `mod_prve` (`id`, `license`, `localkey`) VALUES (1, 'null', NULL); 8 | CREATE TABLE IF NOT EXISTS `mod_prve_ip_addresses` ( 9 | `id` int(11) NOT NULL AUTO_INCREMENT, 10 | `pool_id` int(11) NOT NULL DEFAULT '0', 11 | `ipaddress` varchar(255) NOT NULL DEFAULT '0', 12 | `mask` varchar(255) NOT NULL DEFAULT '0', 13 | PRIMARY KEY (`id`), 14 | UNIQUE KEY `ipaddress` (`ipaddress`) 15 | ); 16 | CREATE TABLE IF NOT EXISTS `mod_prve_ip_pools` ( 17 | `id` int(11) NOT NULL AUTO_INCREMENT, 18 | `title` varchar(255) NOT NULL, 19 | `gateway` varchar(100) DEFAULT NULL, 20 | PRIMARY KEY (`id`) 21 | ); 22 | CREATE TABLE IF NOT EXISTS `mod_prve_plans` ( 23 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 24 | `title` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT 'Plan name', 25 | `vmtype` varchar(8) NOT NULL COMMENT 'Type of Guest e.g KVM or Openvz or others in feuture', 26 | `ostype` varchar(8) DEFAULT NULL COMMENT 'Operating System Type', 27 | `cpus` tinyint(2) unsigned DEFAULT NULL, 28 | `cpuemu` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT 'Emulated CPU Type e.g: 486 | athlon | pentium | pentium2 | pentium3 | coreduo | core2duo | kvm32 | kvm64 | qemu32 | qemu64 | phenom | Conroe | Penryn | Nehalem | Westmere | SandyBridge | IvyBridge | Haswell | Broadwell | Opteron_G1 | Opteron_G2 | Opteron_G3 | Opteron_G4 | Opteron_G5 | host', 29 | `cores` tinyint(2) unsigned DEFAULT NULL COMMENT 'The number of cores per socket', 30 | `cpulimit` smallint(5) unsigned DEFAULT NULL COMMENT 'Limit of CPU usage. Note if the computer has 2 CPUs, it has total of ''2'' CPU time. Value ''0'' indicates no CPU limit.', 31 | `cpuunits` smallint(5) unsigned DEFAULT NULL, 32 | `memory` smallint(5) unsigned NOT NULL, 33 | `swap` smallint(5) unsigned DEFAULT NULL, 34 | `disk` smallint(5) unsigned DEFAULT NULL, 35 | `iopriority` varchar(10) DEFAULT '4', 36 | `diskformat` varchar(10) DEFAULT NULL, 37 | `diskcache` varchar(20) DEFAULT NULL, 38 | `disktype` varchar(20) DEFAULT NULL, 39 | `netmode` varchar(10) DEFAULT NULL, 40 | `bridge` varchar(20) NOT NULL DEFAULT 'vmbr', 41 | `vmbr` tinyint(1) unsigned NOT NULL DEFAULT '0', 42 | `netmodel` varchar(10) DEFAULT NULL, 43 | `netrate` varchar(5) DEFAULT NULL, 44 | `firewall` tinyint(1) unsigned NOT NULL DEFAULT '0', 45 | `bw` int(6) unsigned DEFAULT NULL, 46 | `kvm` tinyint(1) unsigned DEFAULT '0', 47 | `onboot` tinyint(1) unsigned DEFAULT '0', 48 | PRIMARY KEY (`id`) 49 | ); 50 | CREATE TABLE IF NOT EXISTS `mod_prve_vms` ( 51 | `id` int(10) unsigned NOT NULL, 52 | `user_id` int(10) unsigned NOT NULL, 53 | `vtype` varchar(255) NOT NULL, 54 | `ipaddress` varchar(255) NOT NULL, 55 | `subnetmask` varchar(255) NOT NULL, 56 | `gateway` varchar(255) NOT NULL, 57 | `created` datetime DEFAULT NULL, 58 | PRIMARY KEY (`id`) 59 | ); -------------------------------------------------------------------------------- /modules/addons/prve/hooks.php: -------------------------------------------------------------------------------- 1 | constructor_success = false; 18 | return false ; 19 | } 20 | // Check hostname resolves. 21 | if (gethostbyname($hostname) == $hostname && !filter_var($hostname, FILTER_VALIDATE_IP)) { 22 | $this->constructor_success = false; 23 | return false ; 24 | } 25 | // Check port is between 1 and 65535. 26 | if (!is_int($port) || $port < 1 || $port > 65535) { 27 | $this->constructor_success = false; 28 | return false ; 29 | } 30 | // Check that verify_ssl is boolean. 31 | if (!is_bool($verify_ssl)) { 32 | $this->constructor_success = false; 33 | return false ; 34 | } 35 | 36 | $this->hostname = $hostname; 37 | $this->username = $username; 38 | $this->realm = $realm; 39 | $this->password = $password; 40 | $this->port = $port; 41 | $this->verify_ssl = $verify_ssl; 42 | } 43 | 44 | /* 45 | * bool login () 46 | * Performs login to PVE Server using JSON API, and obtains Access Ticket. 47 | */ 48 | public function login () { 49 | // Prepare login variables. 50 | $login_postfields = array(); 51 | $login_postfields['username'] = $this->username; 52 | $login_postfields['password'] = $this->password; 53 | $login_postfields['realm'] = $this->realm; 54 | 55 | $login_postfields_string = http_build_query($login_postfields); 56 | unset($login_postfields); 57 | 58 | // Perform login request. 59 | $prox_ch = curl_init(); 60 | curl_setopt($prox_ch, CURLOPT_URL, "https://{$this->hostname}:{$this->port}/api2/json/access/ticket"); 61 | curl_setopt($prox_ch, CURLOPT_POST, true); 62 | curl_setopt($prox_ch, CURLOPT_RETURNTRANSFER, true); 63 | curl_setopt($prox_ch, CURLOPT_POSTFIELDS, $login_postfields_string); 64 | curl_setopt($prox_ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl); 65 | 66 | $login_ticket = curl_exec($prox_ch); 67 | $login_request_info = curl_getinfo($prox_ch); 68 | 69 | curl_close($prox_ch); 70 | unset($prox_ch); 71 | unset($login_postfields_string); 72 | 73 | if (!$login_ticket) { 74 | // SSL negotiation failed or connection timed out 75 | $this->login_ticket_timestamp = null; 76 | return false; 77 | } 78 | 79 | $login_ticket_data = json_decode($login_ticket, true); 80 | if ($login_ticket_data == null || $login_ticket_data['data'] == null) { 81 | // Login failed. 82 | // Just to be safe, set this to null again. 83 | $this->login_ticket_timestamp = null; 84 | if ($login_request_info['ssl_verify_result'] == 1) { 85 | $this->constructor_success = false; 86 | return false ; 87 | } 88 | return false; 89 | } else { 90 | // Login success. 91 | $this->login_ticket = $login_ticket_data['data']; 92 | // We store a UNIX timestamp of when the ticket was generated here, 93 | // so we can identify when we need a new one expiration-wise later 94 | // on... 95 | $this->login_ticket_timestamp = time(); 96 | $this->reload_node_list(); 97 | return true; 98 | } 99 | } 100 | 101 | # Sets the PVEAuthCookie 102 | # Attetion, after using this the user is logged into the web interface aswell! 103 | # Use with care, and DO NOT use with root, it may harm your system 104 | public function setCookie() { 105 | if (!$this->check_login_ticket()) { 106 | $this->constructor_success = false; 107 | return false ; 108 | } 109 | 110 | setrawcookie("PVEAuthCookie", $this->login_ticket['ticket'], 0, "/"); 111 | } 112 | 113 | /* 114 | * bool check_login_ticket () 115 | * Checks if the login ticket is valid still, returns false if not. 116 | * Method of checking is purely by age of ticket right now... 117 | */ 118 | protected function check_login_ticket () { 119 | if ($this->login_ticket == null) { 120 | // Just to be safe, set this to null again. 121 | $this->login_ticket_timestamp = null; 122 | return false; 123 | } 124 | if ($this->login_ticket_timestamp >= (time() + 7200)) { 125 | // Reset login ticket object values. 126 | $this->login_ticket = null; 127 | $this->login_ticket_timestamp = null; 128 | return false; 129 | } else { 130 | return true; 131 | } 132 | } 133 | 134 | /* 135 | * object action (string action_path, string http_method[, array put_post_parameters]) 136 | * This method is responsible for the general cURL requests to the JSON API, 137 | * and sits behind the abstraction layer methods get/put/post/delete etc. 138 | */ 139 | private function action ($action_path, $http_method, $put_post_parameters = null) { 140 | // Check if we have a prefixed / on the path, if not add one. 141 | if (substr($action_path, 0, 1) != "/") { 142 | $action_path = "/".$action_path; 143 | } 144 | 145 | if (!$this->check_login_ticket()) { 146 | $this->constructor_success = false; 147 | return false ; 148 | } 149 | 150 | // Prepare cURL resource. 151 | $prox_ch = curl_init(); 152 | curl_setopt($prox_ch, CURLOPT_URL, "https://{$this->hostname}:{$this->port}/api2/json{$action_path}"); 153 | 154 | $put_post_http_headers = array(); 155 | $put_post_http_headers[] = "CSRFPreventionToken: {$this->login_ticket['CSRFPreventionToken']}"; 156 | // Lets decide what type of action we are taking... 157 | switch ($http_method) { 158 | case "GET": 159 | // Nothing extra to do. 160 | curl_setopt($prox_ch, CURLOPT_URL, "https://{$this->hostname}:{$this->port}/api2/json{$action_path}?".http_build_query($put_post_parameters)); 161 | break; 162 | case "PUT": 163 | curl_setopt($prox_ch, CURLOPT_CUSTOMREQUEST, "PUT"); 164 | 165 | // Set "POST" data. 166 | $action_postfields_string = http_build_query($put_post_parameters); 167 | curl_setopt($prox_ch, CURLOPT_POSTFIELDS, $action_postfields_string); 168 | unset($action_postfields_string); 169 | 170 | // Add required HTTP headers. 171 | curl_setopt($prox_ch, CURLOPT_HTTPHEADER, $put_post_http_headers); 172 | break; 173 | case "POST": 174 | curl_setopt($prox_ch, CURLOPT_POST, true); 175 | 176 | // Set POST data. 177 | $action_postfields_string = http_build_query($put_post_parameters); 178 | curl_setopt($prox_ch, CURLOPT_POSTFIELDS, $action_postfields_string); 179 | unset($action_postfields_string); 180 | 181 | // Add required HTTP headers. 182 | curl_setopt($prox_ch, CURLOPT_HTTPHEADER, $put_post_http_headers); 183 | break; 184 | case "DELETE": 185 | curl_setopt($prox_ch, CURLOPT_CUSTOMREQUEST, "DELETE"); 186 | // No "POST" data required, the delete destination is specified in the URL. 187 | 188 | // Add required HTTP headers. 189 | curl_setopt($prox_ch, CURLOPT_HTTPHEADER, $put_post_http_headers); 190 | break; 191 | default: 192 | //throw new PVE2_Exception("Error - Invalid HTTP Method specified.", 5); 193 | return false; 194 | } 195 | 196 | curl_setopt($prox_ch, CURLOPT_HEADER, true); 197 | curl_setopt($prox_ch, CURLOPT_RETURNTRANSFER, true); 198 | curl_setopt($prox_ch, CURLOPT_COOKIE, "PVEAuthCookie=".$this->login_ticket['ticket']); 199 | curl_setopt($prox_ch, CURLOPT_SSL_VERIFYPEER, false); 200 | 201 | $action_response = curl_exec($prox_ch); 202 | 203 | curl_close($prox_ch); 204 | unset($prox_ch); 205 | 206 | $split_action_response = explode("\r\n\r\n", $action_response, 2); 207 | $header_response = $split_action_response[0]; 208 | $body_response = $split_action_response[1]; 209 | $action_response_array = json_decode($body_response, true); 210 | 211 | $action_response_export = var_export($action_response_array, true); 212 | error_log("----------------------------------------------\n" . 213 | "FULL RESPONSE:\n\n{$action_response}\n\nEND FULL RESPONSE\n\n" . 214 | "Headers:\n\n{$header_response}\n\nEnd Headers\n\n" . 215 | "Data:\n\n{$body_response}\n\nEnd Data\n\n" . 216 | "RESPONSE ARRAY:\n\n{$action_response_export}\n\nEND RESPONSE ARRAY\n" . 217 | "----------------------------------------------"); 218 | 219 | unset($action_response); 220 | unset($action_response_export); 221 | 222 | // Parse response, confirm HTTP response code etc. 223 | $split_headers = explode("\r\n", $header_response); 224 | if (substr($split_headers[0], 0, 9) == "HTTP/1.1 ") { 225 | $split_http_response_line = explode(" ", $split_headers[0]); 226 | if ($split_http_response_line[1] == "200") { 227 | if ($http_method == "PUT") { 228 | return true; 229 | } else { 230 | return $action_response_array['data']; 231 | } 232 | } else { 233 | error_log("This API Request Failed.\n" . 234 | "HTTP Response - {$split_http_response_line[1]}\n" . 235 | "HTTP Error - {$split_headers[0]}"); 236 | return false; 237 | } 238 | } else { 239 | error_log("Error - Invalid HTTP Response.\n" . var_export($split_headers, true)); 240 | return false; 241 | } 242 | 243 | if (!empty($action_response_array['data'])) { 244 | return $action_response_array['data']; 245 | } else { 246 | error_log("\$action_response_array['data'] is empty. Returning false.\n" . 247 | var_export($action_response_array['data'], true)); 248 | return false; 249 | } 250 | } 251 | 252 | /* 253 | * array reload_node_list () 254 | * Returns the list of node names as provided by /api2/json/nodes. 255 | * We need this for future get/post/put/delete calls. 256 | * ie. $this->get("nodes/XXX/status"); where XXX is one of the values from this return array. 257 | */ 258 | public function reload_node_list () { 259 | $node_list = $this->get("/nodes"); 260 | if (count($node_list) > 0) { 261 | $nodes_array = array(); 262 | foreach ($node_list as $node) { 263 | $nodes_array[] = $node['node']; 264 | } 265 | $this->cluster_node_list = $nodes_array; 266 | return true; 267 | } else { 268 | error_log(" Empty list of nodes returned in this cluster."); 269 | return false; 270 | } 271 | } 272 | 273 | /* 274 | * array get_node_list () 275 | * 276 | */ 277 | public function get_node_list () { 278 | // We run this if we haven't queried for cluster nodes as yet, and cache it in the object. 279 | if ($this->cluster_node_list == null) { 280 | if ($this->reload_node_list() === false) { 281 | return false; 282 | } 283 | } 284 | 285 | return $this->cluster_node_list; 286 | } 287 | 288 | /* 289 | * bool|int get_next_vmid () 290 | * Get Last VMID from a Cluster or a Node 291 | * returns a VMID, or false if not found. 292 | */ 293 | public function get_next_vmid () { 294 | $vmid = $this->get("/cluster/nextid"); 295 | if ($vmid == null) { 296 | return false; 297 | } else { 298 | return $vmid; 299 | } 300 | } 301 | 302 | /* 303 | * bool|string get_version () 304 | * Return the version and minor revision of Proxmox Server 305 | */ 306 | public function get_version () { 307 | $version = $this->get("/version"); 308 | if ($version == null) { 309 | return false; 310 | } else { 311 | return $version['version']; 312 | } 313 | } 314 | 315 | /* 316 | * object/array? get (string action_path) 317 | */ 318 | public function get ($action_path,$parameters='null') { 319 | return $this->action($action_path, "GET",$parameters); 320 | } 321 | 322 | /* 323 | * bool put (string action_path, array parameters) 324 | */ 325 | public function put ($action_path, $parameters) { 326 | return $this->action($action_path, "PUT", $parameters); 327 | } 328 | 329 | /* 330 | * bool post (string action_path, array parameters) 331 | */ 332 | public function post ($action_path, $parameters) { 333 | return $this->action($action_path, "POST", $parameters); 334 | } 335 | 336 | /* 337 | * bool delete (string action_path) 338 | */ 339 | public function delete ($action_path) { 340 | return $this->action($action_path, "DELETE"); 341 | } 342 | 343 | // Logout not required, PVEAuthCookie tokens have a 2 hour lifetime. 344 | } 345 | 346 | 347 | function prve_check_license($licensekey, $localkey='') { 348 | 349 | // ----------------------------------- 350 | // -- Configuration Values -- 351 | // ----------------------------------- 352 | 353 | // Enter the url to your WHMCS installation here 354 | $whmcsurl = 'http://www.moduleland.com/'; 355 | // Must match what is specified in the MD5 Hash Verification field 356 | // of the licensing product that will be used with this check. 357 | $licensing_secret_key = 'q8e1BNyxo7HEo7wGDoyX3Bp5wno2s4HC'; 358 | // The number of days to wait between performing remote license checks 359 | $localkeydays = 15; 360 | // The number of days to allow failover for after local key expiry 361 | $allowcheckfaildays = 5; 362 | 363 | // ----------------------------------- 364 | // -- Do not edit below this line -- 365 | // ----------------------------------- 366 | 367 | $check_token = time() . md5(mt_rand(1000000000, 9999999999) . $licensekey); 368 | $checkdate = date("Ymd"); 369 | $domain = $_SERVER['SERVER_NAME']; 370 | $usersip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']; 371 | $dirpath = dirname(__FILE__); 372 | $verifyfilepath = 'modules/servers/licensing/verify.php'; 373 | $localkeyvalid = false; 374 | if ($localkey) { 375 | $localkey = str_replace("\n", '', $localkey); # Remove the line breaks 376 | $localdata = substr($localkey, 0, strlen($localkey) - 32); # Extract License Data 377 | $md5hash = substr($localkey, strlen($localkey) - 32); # Extract MD5 Hash 378 | if ($md5hash == md5($localdata . $licensing_secret_key)) { 379 | $localdata = strrev($localdata); # Reverse the string 380 | $md5hash = substr($localdata, 0, 32); # Extract MD5 Hash 381 | $localdata = substr($localdata, 32); # Extract License Data 382 | $localdata = base64_decode($localdata); 383 | $localkeyresults = unserialize($localdata); 384 | $originalcheckdate = $localkeyresults['checkdate']; 385 | if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) { 386 | $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y"))); 387 | if ($originalcheckdate > $localexpiry) { 388 | $localkeyvalid = true; 389 | $results = $localkeyresults; 390 | $validdomains = explode(',', $results['validdomain']); 391 | if (!in_array($_SERVER['SERVER_NAME'], $validdomains)) { 392 | $localkeyvalid = false; 393 | $localkeyresults['status'] = "Invalid"; 394 | $results = array(); 395 | } 396 | $validips = explode(',', $results['validip']); 397 | if (!in_array($usersip, $validips)) { 398 | $localkeyvalid = false; 399 | $localkeyresults['status'] = "Invalid"; 400 | $results = array(); 401 | } 402 | $validdirs = explode(',', $results['validdirectory']); 403 | if (!in_array($dirpath, $validdirs)) { 404 | $localkeyvalid = false; 405 | $localkeyresults['status'] = "Invalid"; 406 | $results = array(); 407 | } 408 | } 409 | } 410 | } 411 | } 412 | if (!$localkeyvalid) { 413 | $responseCode = 0; 414 | $postfields = array( 415 | 'licensekey' => $licensekey, 416 | 'domain' => $domain, 417 | 'ip' => $usersip, 418 | 'dir' => $dirpath, 419 | ); 420 | if ($check_token) $postfields['check_token'] = $check_token; 421 | $query_string = ''; 422 | foreach ($postfields AS $k=>$v) { 423 | $query_string .= $k.'='.urlencode($v).'&'; 424 | } 425 | if (function_exists('curl_exec')) { 426 | $ch = curl_init(); 427 | curl_setopt($ch, CURLOPT_URL, $whmcsurl . $verifyfilepath); 428 | curl_setopt($ch, CURLOPT_POST, 1); 429 | curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); 430 | curl_setopt($ch, CURLOPT_TIMEOUT, 30); 431 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 432 | $data = curl_exec($ch); 433 | $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 434 | curl_close($ch); 435 | } else { 436 | $responseCodePattern = '/^HTTP\/\d+\.\d+\s+(\d+)/'; 437 | $fp = @fsockopen($whmcsurl, 80, $errno, $errstr, 5); 438 | if ($fp) { 439 | $newlinefeed = "\r\n"; 440 | $header = "POST ".$whmcsurl . $verifyfilepath . " HTTP/1.0" . $newlinefeed; 441 | $header .= "Host: ".$whmcsurl . $newlinefeed; 442 | $header .= "Content-type: application/x-www-form-urlencoded" . $newlinefeed; 443 | $header .= "Content-length: ".@strlen($query_string) . $newlinefeed; 444 | $header .= "Connection: close" . $newlinefeed . $newlinefeed; 445 | $header .= $query_string; 446 | $data = $line = ''; 447 | @stream_set_timeout($fp, 20); 448 | @fputs($fp, $header); 449 | $status = @socket_get_status($fp); 450 | while (!@feof($fp)&&$status) { 451 | $line = @fgets($fp, 1024); 452 | $patternMatches = array(); 453 | if (!$responseCode 454 | && preg_match($responseCodePattern, trim($line), $patternMatches) 455 | ) { 456 | $responseCode = (empty($patternMatches[1])) ? 0 : $patternMatches[1]; 457 | } 458 | $data .= $line; 459 | $status = @socket_get_status($fp); 460 | } 461 | @fclose ($fp); 462 | } 463 | } 464 | if ($responseCode != 200) { 465 | $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - ($localkeydays + $allowcheckfaildays), date("Y"))); 466 | if ($originalcheckdate > $localexpiry) { 467 | $results = $localkeyresults; 468 | } else { 469 | $results = array(); 470 | $results['status'] = "Invalid"; 471 | $results['description'] = "Remote Check Failed"; 472 | return $results; 473 | } 474 | } else { 475 | preg_match_all('/<(.*?)>([^<]+)<\/\\1>/i', $data, $matches); 476 | $results = array(); 477 | foreach ($matches[1] AS $k=>$v) { 478 | $results[$v] = $matches[2][$k]; 479 | } 480 | } 481 | if (!is_array($results)) { 482 | die("Invalid License Server Response"); 483 | } 484 | if ($results['md5hash']) { 485 | if ($results['md5hash'] != md5($licensing_secret_key . $check_token)) { 486 | $results['status'] = "Invalid"; 487 | $results['description'] = "MD5 Checksum Verification Failed"; 488 | return $results; 489 | } 490 | } 491 | if ($results['status'] == "Active") { 492 | $results['checkdate'] = $checkdate; 493 | $data_encoded = serialize($results); 494 | $data_encoded = base64_encode($data_encoded); 495 | $data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded; 496 | $data_encoded = strrev($data_encoded); 497 | $data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key); 498 | $data_encoded = wordwrap($data_encoded, 80, "\n", true); 499 | $results['localkey'] = $data_encoded; 500 | } 501 | $results['remotecheck'] = true; 502 | } 503 | unset($postfields,$data,$matches,$whmcsurl,$licensing_secret_key,$checkdate,$usersip,$localkeydays,$allowcheckfaildays,$md5hash); 504 | return $results; 505 | } 506 | 507 | 508 | ?> 509 | -------------------------------------------------------------------------------- /modules/servers/prve/VncViewer.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/VncViewer.jar -------------------------------------------------------------------------------- /modules/servers/prve/clientarea.tpl: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 |
14 | 15 |
16 |
17 |
18 |
19 |
20 | {$vm_status['status']}
21 | Up Time: {$vm_status['uptime']} 22 | 23 |
24 |
25 |
26 | 27 |
28 |
CPU
29 |
30 |
31 |
RAM
32 |
33 |
34 |
Disk
35 |
36 |
37 |
Swap
38 |
39 |
40 | 54 |
55 |
56 |
57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 91 | 92 |
Assigned IPv4 Address{$vm_config['ipv4']} Subnet Mask: {$vm_config['netmask4']} Gateway: {$vm_config['gateway4']}
OS type{$vm_config['ostype']}
CPU{$vm_config['sockets']} {$vm_config['cpu']} {$vm_config['cores']} core(s).
Memory (RAM){$vm_config['memory']} MB
Primary Network Interface{($vm_config['net0']|replace:',':'
')}
Secondary Network Interface{$vm_config['net1']}
Hard Disk 85 | {$rootfs=(","|explode:$vm_config['rootfs'])} 86 | {$disk=(","|explode:$vm_config['ide0'])} 87 | {$disk[1]} 88 | {$rootfs[1]} 89 | 90 |
{$vm_config['scsci0']}
93 | {if ($smarty.get.a eq 'vmStat')} 94 |

Virtual Machine Statistics

95 | 101 |
102 |
103 | 104 | 105 | 106 | 107 |
108 |
109 | 110 | 111 | 112 | 113 |
114 |
115 | 116 | 117 | 118 | 119 |
120 |
121 | 122 | 123 | 124 | 125 |
126 |
127 | {/if} 128 | 129 | 130 |
131 | -------------------------------------------------------------------------------- /modules/servers/prve/img/lxc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/lxc.png -------------------------------------------------------------------------------- /modules/servers/prve/img/novnc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/novnc.png -------------------------------------------------------------------------------- /modules/servers/prve/img/online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/online.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/centos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/centos.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/debian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/debian.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/ubuntu.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/w2k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/w2k.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/w2k3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/w2k3.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/w2k8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/w2k8.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/win7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/win7.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/wvista.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/wvista.png -------------------------------------------------------------------------------- /modules/servers/prve/img/os/wxp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/os/wxp.png -------------------------------------------------------------------------------- /modules/servers/prve/img/qemu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/qemu.png -------------------------------------------------------------------------------- /modules/servers/prve/img/running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/running.png -------------------------------------------------------------------------------- /modules/servers/prve/img/stopped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/stopped.png -------------------------------------------------------------------------------- /modules/servers/prve/img/suspended.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/suspended.png -------------------------------------------------------------------------------- /modules/servers/prve/img/tigervnc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/img/tigervnc.png -------------------------------------------------------------------------------- /modules/servers/prve/js/CircularLoader.js: -------------------------------------------------------------------------------- 1 | !function (r) { function e(r) { return r * Math.PI / 180 } function t(t, a, s) { var o = r("#" + s + "canvas")[0], n = r("#" + s + "canvas"), i = o.getContext("2d"), l = o.width / 2, p = o.height / 2; i.beginPath(), i.arc(l, p, r(n).attr("data-radius"), -e(90), -e(90) + e(t / 100 * 360), !1), i.fillStyle = "transparent", i.fill(), i.lineWidth = r(n).attr("data-width"), i.strokeStyle = r(n).attr("data-stroke"), i.stroke(), i.closePath(), "true" == r(n).attr("data-text").toLocaleLowerCase() && r("#" + s + " .clProg").val(a + ("true" == r(n).attr("data-percent").toLocaleLowerCase() ? "%" : "")) } r.fn.circularloader = function (e) { function a() { u.beginPath(), u.arc(f, h, i, 0, 2 * Math.PI, !1), u.fillStyle = n.backgroundColor, u.fill(), u.lineWidth = l, u.strokeStyle = n.progressBarBackground, u.stroke(), u.closePath(), d > 0 && t(d, p, o) } var s = this[0], o = s.id; if (0 == r("#" + o + " canvas").length) { var n = r.extend({ backgroundColor: "#ffffff", fontColor: "#000000", fontSize: "40px", radius: 70, progressBarBackground: "#cdcdcd", progressBarColor: "#aaaaaa", progressBarWidth: 25, progressPercent: 0, progressValue: 0, showText: !0 }, e), i = parseInt(n.radius), l = parseInt(n.progressBarWidth), p = parseInt(parseInt(n.progressValue) > 0 ? n.progressValue : n.progressPercent), d = parseInt(n.progressPercent), c = "color:" + n.fontColor + ";font-size:" + parseInt(n.fontSize) + "px;width:" + 2 * (i + l) + "px;vertical-align:middle;position:relative;background-color:transparent;border:0 none;transform:translateY(-48%);-webkit-transform: translateY(-48%);-ms-transform: translateY(-48%);height:" + 2 * (i + l) + "px;margin-left:-" + 2 * (i + l) + "px;text-align:center;padding:0;" + (n.showText ? "" : "display:none;"); r('').appendTo(s), r("#" + o).css("height", 2 * (i + l)); { var g = r("#" + o + "canvas")[0], u = g.getContext("2d"), f = g.width / 2, h = g.height / 2; r("#" + o + "canvas").offset().left, r("#" + o + "canvas").offset().top } a() } else if (void 0 != e.progressPercent || void 0 != e.progressValue) { var d = 0, p = 0; d = void 0 == e.progressPercent ? parseInt(e.progressValue) > 100 ? 100 : parseInt(e.progressValue) : parseInt(e.progressPercent) > 100 ? 100 : parseInt(e.progressPercent), p = void 0 == e.progressValue ? parseInt(e.progressPercent) > 100 ? 100 : parseInt(e.progressPercent) : parseInt(e.progressValue), t(d, p, o) } return this } }(jQuery); -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/alt.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/clipboard.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/connect.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/ctrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/ctrl.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/ctrlaltdel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/ctrlaltdel.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/disconnect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/disconnect.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/drag.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/esc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/esc.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/favicon.ico -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/favicon.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/fullscreen.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/keyboard.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/mouse_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/mouse_left.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/mouse_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/mouse_middle.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/mouse_none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/mouse_none.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/mouse_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/mouse_right.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/power.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/screen_320x460.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/screen_320x460.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/screen_57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/screen_57x57.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/screen_700x700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/screen_700x700.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/settings.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/showextrakeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/showextrakeys.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/images/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/images/tab.png -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/Orbitron700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/include/Orbitron700.ttf -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/Orbitron700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/include/Orbitron700.woff -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/base.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC base CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | body { 10 | margin:0; 11 | padding:0; 12 | font-family: Helvetica; 13 | /*Background image with light grey curve.*/ 14 | background-color:#494949; 15 | background-repeat:no-repeat; 16 | background-position:right bottom; 17 | height:100%; 18 | } 19 | 20 | html { 21 | height:100%; 22 | } 23 | 24 | #noVNC_controls ul { 25 | list-style: none; 26 | margin: 0px; 27 | padding: 0px; 28 | } 29 | #noVNC_controls li { 30 | padding-bottom:8px; 31 | } 32 | 33 | #noVNC_host { 34 | width:150px; 35 | } 36 | #noVNC_port { 37 | width: 80px; 38 | } 39 | #noVNC_password { 40 | width: 150px; 41 | } 42 | #noVNC_encrypt { 43 | } 44 | #noVNC_path { 45 | width: 100px; 46 | } 47 | #noVNC_connect_button { 48 | width: 110px; 49 | float:right; 50 | } 51 | 52 | #noVNC_buttons { 53 | white-space: nowrap; 54 | } 55 | 56 | #noVNC_view_drag_button { 57 | display: none; 58 | } 59 | #sendCtrlAltDelButton { 60 | display: none; 61 | } 62 | #fullscreenButton { 63 | display: none; 64 | } 65 | #noVNC_xvp_buttons { 66 | display: none; 67 | } 68 | #noVNC_mobile_buttons { 69 | display: none; 70 | } 71 | 72 | #noVNC_extra_keys { 73 | display: inline; 74 | list-style-type: none; 75 | padding: 0px; 76 | margin: 0px; 77 | position: relative; 78 | } 79 | 80 | .noVNC-buttons-left { 81 | float: left; 82 | z-index: 1; 83 | position: relative; 84 | } 85 | 86 | .noVNC-buttons-right { 87 | float:right; 88 | right: 0px; 89 | z-index: 2; 90 | position: absolute; 91 | } 92 | 93 | #noVNC_status { 94 | font-size: 12px; 95 | padding-top: 4px; 96 | height:32px; 97 | text-align: center; 98 | font-weight: bold; 99 | color: #fff; 100 | } 101 | 102 | #noVNC_settings_menu { 103 | margin: 3px; 104 | text-align: left; 105 | } 106 | #noVNC_settings_menu ul { 107 | list-style: none; 108 | margin: 0px; 109 | padding: 0px; 110 | } 111 | 112 | #noVNC_apply { 113 | float:right; 114 | } 115 | 116 | /* Do not set width/height for VNC_screen or VNC_canvas or incorrect 117 | * scaling will occur. Canvas resizes to remote VNC settings */ 118 | #noVNC_screen { 119 | display: table; 120 | width:100%; 121 | height:100%; 122 | background-color:#313131; 123 | border-bottom-right-radius: 800px 600px; 124 | /*border-top-left-radius: 800px 600px;*/ 125 | } 126 | 127 | #noVNC_container { 128 | display: none; 129 | position: absolute; 130 | margin: 0px; 131 | padding: 0px; 132 | bottom: 0px; 133 | top: 36px; /* the height of the control bar */ 134 | left: 0px; 135 | right: 0px; 136 | width: auto; 137 | height: auto; 138 | } 139 | 140 | #noVNC_canvas { 141 | position: absolute; 142 | left: 0; 143 | right: 0; 144 | margin-left: auto; 145 | margin-right: auto; 146 | } 147 | 148 | #VNC_clipboard_clear_button { 149 | float:right; 150 | } 151 | #VNC_clipboard_text { 152 | font-size: 11px; 153 | } 154 | 155 | #noVNC_clipboard_clear_button { 156 | float:right; 157 | } 158 | 159 | /*Bubble contents divs*/ 160 | #noVNC_settings { 161 | display:none; 162 | margin-top:73px; 163 | right:20px; 164 | position:fixed; 165 | } 166 | 167 | #noVNC_controls { 168 | display:none; 169 | margin-top:73px; 170 | right:12px; 171 | position:fixed; 172 | } 173 | #noVNC_controls.top:after { 174 | right:15px; 175 | } 176 | 177 | #noVNC_description { 178 | display:none; 179 | position:fixed; 180 | 181 | margin-top:73px; 182 | right:20px; 183 | left:20px; 184 | padding:15px; 185 | color:#000; 186 | background:#eee; /* default background for browsers without gradient support */ 187 | 188 | border:2px solid #E0E0E0; 189 | -webkit-border-radius:10px; 190 | -moz-border-radius:10px; 191 | border-radius:10px; 192 | } 193 | 194 | #noVNC_popup_status { 195 | display:none; 196 | position: fixed; 197 | z-index: 1; 198 | 199 | margin:15px; 200 | margin-top:60px; 201 | padding:15px; 202 | width:auto; 203 | 204 | text-align:center; 205 | font-weight:bold; 206 | word-wrap:break-word; 207 | color:#fff; 208 | background:rgba(0,0,0,0.65); 209 | 210 | -webkit-border-radius:10px; 211 | -moz-border-radius:10px; 212 | border-radius:10px; 213 | } 214 | 215 | #noVNC_xvp { 216 | display:none; 217 | margin-top:73px; 218 | right:30px; 219 | position:fixed; 220 | } 221 | #noVNC_xvp.top:after { 222 | right:125px; 223 | } 224 | 225 | #noVNC_clipboard { 226 | display:none; 227 | margin-top:73px; 228 | right:30px; 229 | position:fixed; 230 | } 231 | #noVNC_clipboard.top:after { 232 | right:85px; 233 | } 234 | 235 | #keyboardinput { 236 | width:1px; 237 | height:1px; 238 | background-color:#fff; 239 | color:#fff; 240 | border:0; 241 | position: relative; 242 | left: -40px; 243 | z-index: -1; 244 | ime-mode: disabled; 245 | } 246 | 247 | /* 248 | * Advanced Styling 249 | */ 250 | 251 | .noVNC_status_normal { 252 | background: #b2bdcd; /* Old browsers */ 253 | background: -moz-linear-gradient(top, #b2bdcd 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 254 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b2bdcd), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 255 | background: -webkit-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 256 | background: -o-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 257 | background: -ms-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 258 | background: linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 259 | } 260 | .noVNC_status_error { 261 | background: #f04040; /* Old browsers */ 262 | background: -moz-linear-gradient(top, #f04040 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 263 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f04040), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 264 | background: -webkit-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 265 | background: -o-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 266 | background: -ms-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 267 | background: linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 268 | } 269 | .noVNC_status_warn { 270 | background: #f0f040; /* Old browsers */ 271 | background: -moz-linear-gradient(top, #f0f040 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 272 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0f040), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 273 | background: -webkit-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 274 | background: -o-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 275 | background: -ms-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 276 | background: linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 277 | } 278 | 279 | /* Control bar */ 280 | #noVNC-control-bar { 281 | position:fixed; 282 | 283 | display:block; 284 | height:36px; 285 | left:0; 286 | top:0; 287 | width:100%; 288 | z-index:200; 289 | } 290 | 291 | .noVNC_status_button { 292 | padding: 4px 4px; 293 | vertical-align: middle; 294 | border:1px solid #869dbc; 295 | -webkit-border-radius: 6px; 296 | -moz-border-radius: 6px; 297 | border-radius: 6px; 298 | background: #b2bdcd; /* Old browsers */ 299 | background: -moz-linear-gradient(top, #b2bdcd 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 300 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b2bdcd), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 301 | background: -webkit-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 302 | background: -o-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 303 | background: -ms-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 304 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b2bdcd', endColorstr='#6e84a3',GradientType=0 ); /* IE6-9 */ 305 | background: linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 306 | /*box-shadow:inset 0.4px 0.4px 0.4px #000000;*/ 307 | } 308 | 309 | .noVNC_status_button_selected { 310 | padding: 4px 4px; 311 | vertical-align: middle; 312 | border:1px solid #4366a9; 313 | -webkit-border-radius: 6px; 314 | -moz-border-radius: 6px; 315 | background: #779ced; /* Old browsers */ 316 | background: -moz-linear-gradient(top, #779ced 0%, #3970e0 49%, #2160dd 51%, #2463df 100%); /* FF3.6+ */ 317 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#779ced), color-stop(49%,#3970e0), color-stop(51%,#2160dd), color-stop(100%,#2463df)); /* Chrome,Safari4+ */ 318 | background: -webkit-linear-gradient(top, #779ced 0%,#3970e0 49%,#2160dd 51%,#2463df 100%); /* Chrome10+,Safari5.1+ */ 319 | background: -o-linear-gradient(top, #779ced 0%,#3970e0 49%,#2160dd 51%,#2463df 100%); /* Opera11.10+ */ 320 | background: -ms-linear-gradient(top, #779ced 0%,#3970e0 49%,#2160dd 51%,#2463df 100%); /* IE10+ */ 321 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#779ced', endColorstr='#2463df',GradientType=0 ); /* IE6-9 */ 322 | background: linear-gradient(top, #779ced 0%,#3970e0 49%,#2160dd 51%,#2463df 100%); /* W3C */ 323 | /*box-shadow:inset 0.4px 0.4px 0.4px #000000;*/ 324 | } 325 | 326 | .noVNC_status_button:disabled { 327 | opacity: 0.4; 328 | } 329 | 330 | 331 | /*Settings Bubble*/ 332 | .triangle-right { 333 | position:relative; 334 | padding:15px; 335 | margin:1em 0 3em; 336 | color:#fff; 337 | background:#fff; /* default background for browsers without gradient support */ 338 | /* css3 */ 339 | /*background:-webkit-gradient(linear, 0 0, 0 100%, from(#2e88c4), to(#075698)); 340 | background:-moz-linear-gradient(#2e88c4, #075698); 341 | background:-o-linear-gradient(#2e88c4, #075698); 342 | background:linear-gradient(#2e88c4, #075698);*/ 343 | -webkit-border-radius:10px; 344 | -moz-border-radius:10px; 345 | border-radius:10px; 346 | color:#000; 347 | border:2px solid #E0E0E0; 348 | } 349 | 350 | .triangle-right.top:after { 351 | border-color: transparent #E0E0E0; 352 | border-width: 20px 20px 0 0; 353 | bottom: auto; 354 | left: auto; 355 | right: 50px; 356 | top: -20px; 357 | } 358 | 359 | .triangle-right:after { 360 | content:""; 361 | position:absolute; 362 | bottom:-20px; /* value = - border-top-width - border-bottom-width */ 363 | left:50px; /* controls horizontal position */ 364 | border-width:20px 0 0 20px; /* vary these values to change the angle of the vertex */ 365 | border-style:solid; 366 | border-color:#E0E0E0 transparent; 367 | /* reduce the damage in FF3.0 */ 368 | display:block; 369 | width:0; 370 | } 371 | 372 | .triangle-right.top:after { 373 | top:-40px; /* value = - border-top-width - border-bottom-width */ 374 | right:50px; /* controls horizontal position */ 375 | bottom:auto; 376 | left:auto; 377 | border-width:40px 40px 0 0; /* vary these values to change the angle of the vertex */ 378 | border-color:transparent #E0E0E0; 379 | } 380 | 381 | /*Default noVNC logo.*/ 382 | /* From: http://fonts.googleapis.com/css?family=Orbitron:700 */ 383 | @font-face { 384 | font-family: 'Orbitron'; 385 | font-style: normal; 386 | font-weight: 700; 387 | src: local('?'), url('Orbitron700.woff') format('woff'), 388 | url('Orbitron700.ttf') format('truetype'); 389 | } 390 | 391 | #noVNC_logo { 392 | margin-top: 170px; 393 | margin-left: 10px; 394 | color:yellow; 395 | text-align:left; 396 | font-family: 'Orbitron', 'OrbitronTTF', sans-serif; 397 | line-height:90%; 398 | text-shadow: 399 | 5px 5px 0 #000, 400 | -1px -1px 0 #000, 401 | 1px -1px 0 #000, 402 | -1px 1px 0 #000, 403 | 1px 1px 0 #000; 404 | } 405 | 406 | 407 | #noVNC_logo span{ 408 | color:green; 409 | } 410 | 411 | /* ---------------------------------------- 412 | * Media sizing 413 | * ---------------------------------------- 414 | */ 415 | 416 | 417 | .noVNC_status_button { 418 | font-size: 12px; 419 | } 420 | 421 | #noVNC_clipboard_text { 422 | width: 500px; 423 | } 424 | 425 | #noVNC_logo { 426 | font-size: 180px; 427 | } 428 | 429 | .noVNC-buttons-left { 430 | padding-left: 10px; 431 | } 432 | 433 | .noVNC-buttons-right { 434 | padding-right: 10px; 435 | } 436 | 437 | #noVNC_status { 438 | z-index: 0; 439 | position: absolute; 440 | width: 100%; 441 | margin-left: 0px; 442 | } 443 | 444 | #showExtraKeysButton { display: none; } 445 | #toggleCtrlButton { display: inline; } 446 | #toggleAltButton { display: inline; } 447 | #sendTabButton { display: inline; } 448 | #sendEscButton { display: inline; } 449 | 450 | /* left-align the status text on lower resolutions */ 451 | @media screen and (max-width: 800px){ 452 | #noVNC_status { 453 | z-index: 1; 454 | position: relative; 455 | width: auto; 456 | float: left; 457 | margin-left: 4px; 458 | } 459 | } 460 | 461 | @media screen and (max-width: 640px){ 462 | #noVNC_clipboard_text { 463 | width: 410px; 464 | } 465 | #noVNC_logo { 466 | font-size: 150px; 467 | } 468 | .noVNC_status_button { 469 | font-size: 10px; 470 | } 471 | .noVNC-buttons-left { 472 | padding-left: 0px; 473 | } 474 | .noVNC-buttons-right { 475 | padding-right: 0px; 476 | } 477 | /* collapse the extra keys on lower resolutions */ 478 | #showExtraKeysButton { 479 | display: inline; 480 | } 481 | #toggleCtrlButton { 482 | display: none; 483 | position: absolute; 484 | top: 30px; 485 | left: 0px; 486 | } 487 | #toggleAltButton { 488 | display: none; 489 | position: absolute; 490 | top: 65px; 491 | left: 0px; 492 | } 493 | #sendTabButton { 494 | display: none; 495 | position: absolute; 496 | top: 100px; 497 | left: 0px; 498 | } 499 | #sendEscButton { 500 | display: none; 501 | position: absolute; 502 | top: 135px; 503 | left: 0px; 504 | } 505 | } 506 | 507 | @media screen and (min-width: 321px) and (max-width: 480px) { 508 | #noVNC_clipboard_text { 509 | width: 250px; 510 | } 511 | #noVNC_logo { 512 | font-size: 110px; 513 | } 514 | } 515 | 516 | @media screen and (max-width: 320px) { 517 | .noVNC_status_button { 518 | font-size: 9px; 519 | } 520 | #noVNC_clipboard_text { 521 | width: 220px; 522 | } 523 | #noVNC_logo { 524 | font-size: 90px; 525 | } 526 | } 527 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/base64.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | // From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js 6 | 7 | /*jslint white: false */ 8 | /*global console */ 9 | 10 | var Base64 = { 11 | /* Convert data (an array of integers) to a Base64 string. */ 12 | toBase64Table : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''), 13 | base64Pad : '=', 14 | 15 | encode: function (data) { 16 | "use strict"; 17 | var result = ''; 18 | var toBase64Table = Base64.toBase64Table; 19 | var length = data.length; 20 | var lengthpad = (length % 3); 21 | // Convert every three bytes to 4 ascii characters. 22 | 23 | for (var i = 0; i < (length - 2); i += 3) { 24 | result += toBase64Table[data[i] >> 2]; 25 | result += toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)]; 26 | result += toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)]; 27 | result += toBase64Table[data[i + 2] & 0x3f]; 28 | } 29 | 30 | // Convert the remaining 1 or 2 bytes, pad out to 4 characters. 31 | var j = 0; 32 | if (lengthpad === 2) { 33 | j = length - lengthpad; 34 | result += toBase64Table[data[j] >> 2]; 35 | result += toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)]; 36 | result += toBase64Table[(data[j + 1] & 0x0f) << 2]; 37 | result += toBase64Table[64]; 38 | } else if (lengthpad === 1) { 39 | j = length - lengthpad; 40 | result += toBase64Table[data[j] >> 2]; 41 | result += toBase64Table[(data[j] & 0x03) << 4]; 42 | result += toBase64Table[64]; 43 | result += toBase64Table[64]; 44 | } 45 | 46 | return result; 47 | }, 48 | 49 | /* Convert Base64 data to a string */ 50 | /* jshint -W013 */ 51 | toBinaryTable : [ 52 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 53 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 54 | -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 55 | 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, 56 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 57 | 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, 58 | -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 59 | 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 60 | ], 61 | /* jshint +W013 */ 62 | 63 | decode: function (data, offset) { 64 | "use strict"; 65 | offset = typeof(offset) !== 'undefined' ? offset : 0; 66 | var toBinaryTable = Base64.toBinaryTable; 67 | var base64Pad = Base64.base64Pad; 68 | var result, result_length; 69 | var leftbits = 0; // number of bits decoded, but yet to be appended 70 | var leftdata = 0; // bits decoded, but yet to be appended 71 | var data_length = data.indexOf('=') - offset; 72 | 73 | if (data_length < 0) { data_length = data.length - offset; } 74 | 75 | /* Every four characters is 3 resulting numbers */ 76 | result_length = (data_length >> 2) * 3 + Math.floor((data_length % 4) / 1.5); 77 | result = new Array(result_length); 78 | 79 | // Convert one by one. 80 | for (var idx = 0, i = offset; i < data.length; i++) { 81 | var c = toBinaryTable[data.charCodeAt(i) & 0x7f]; 82 | var padding = (data.charAt(i) === base64Pad); 83 | // Skip illegal characters and whitespace 84 | if (c === -1) { 85 | console.error("Illegal character code " + data.charCodeAt(i) + " at position " + i); 86 | continue; 87 | } 88 | 89 | // Collect data into leftdata, update bitcount 90 | leftdata = (leftdata << 6) | c; 91 | leftbits += 6; 92 | 93 | // If we have 8 or more bits, append 8 bits to the result 94 | if (leftbits >= 8) { 95 | leftbits -= 8; 96 | // Append if not padding. 97 | if (!padding) { 98 | result[idx++] = (leftdata >> leftbits) & 0xff; 99 | } 100 | leftdata &= (1 << leftbits) - 1; 101 | } 102 | } 103 | 104 | // If there are any bits left, the base64 string was corrupted 105 | if (leftbits) { 106 | err = new Error('Corrupted base64 string'); 107 | err.name = 'Base64-Error'; 108 | throw err; 109 | } 110 | 111 | return result; 112 | } 113 | }; /* End of Base64 namespace */ 114 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/black.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC black CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | #keyboardinput { 10 | background-color:#000; 11 | } 12 | 13 | .noVNC_status_normal { 14 | background: #4c4c4c; /* Old browsers */ 15 | background: -moz-linear-gradient(top, #4c4c4c 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 16 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 17 | background: -webkit-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 18 | background: -o-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 19 | background: -ms-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 20 | background: linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 21 | } 22 | .noVNC_status_error { 23 | background: #f04040; /* Old browsers */ 24 | background: -moz-linear-gradient(top, #f04040 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 25 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f04040), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 26 | background: -webkit-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 27 | background: -o-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 28 | background: -ms-linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 29 | background: linear-gradient(top, #f04040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 30 | } 31 | .noVNC_status_warn { 32 | background: #f0f040; /* Old browsers */ 33 | background: -moz-linear-gradient(top, #f0f040 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 34 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0f040), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 35 | background: -webkit-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 36 | background: -o-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 37 | background: -ms-linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 38 | background: linear-gradient(top, #f0f040 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 39 | } 40 | 41 | .triangle-right { 42 | border:2px solid #fff; 43 | background:#000; 44 | color:#fff; 45 | } 46 | 47 | .noVNC_status_button { 48 | font-size: 12px; 49 | vertical-align: middle; 50 | border:1px solid #4c4c4c; 51 | 52 | background: #4c4c4c; /* Old browsers */ 53 | background: -moz-linear-gradient(top, #4c4c4c 0%, #2c2c2c 50%, #000000 51%, #131313 100%); /* FF3.6+ */ 54 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(100%,#131313)); /* Chrome,Safari4+ */ 55 | background: -webkit-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Chrome10+,Safari5.1+ */ 56 | background: -o-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* Opera11.10+ */ 57 | background: -ms-linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* IE10+ */ 58 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 ); /* IE6-9 */ 59 | background: linear-gradient(top, #4c4c4c 0%,#2c2c2c 50%,#000000 51%,#131313 100%); /* W3C */ 60 | } 61 | 62 | .noVNC_status_button_selected { 63 | background: #9dd53a; /* Old browsers */ 64 | background: -moz-linear-gradient(top, #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6+ */ 65 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9dd53a), color-stop(50%,#a1d54f), color-stop(51%,#80c217), color-stop(100%,#7cbc0a)); /* Chrome,Safari4+ */ 66 | background: -webkit-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Chrome10+,Safari5.1+ */ 67 | background: -o-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Opera11.10+ */ 68 | background: -ms-linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* IE10+ */ 69 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9dd53a', endColorstr='#7cbc0a',GradientType=0 ); /* IE6-9 */ 70 | background: linear-gradient(top, #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* W3C */ 71 | } 72 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC blue CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | .noVNC_status_normal { 10 | background-color:#04073d; 11 | background-image: -webkit-gradient( 12 | linear, 13 | left bottom, 14 | left top, 15 | color-stop(0.54, rgb(10,15,79)), 16 | color-stop(0.5, rgb(4,7,61)) 17 | ); 18 | background-image: -moz-linear-gradient( 19 | center bottom, 20 | rgb(10,15,79) 54%, 21 | rgb(4,7,61) 50% 22 | ); 23 | } 24 | .noVNC_status_error { 25 | background-color:#f04040; 26 | background-image: -webkit-gradient( 27 | linear, 28 | left bottom, 29 | left top, 30 | color-stop(0.54, rgb(240,64,64)), 31 | color-stop(0.5, rgb(4,7,61)) 32 | ); 33 | background-image: -moz-linear-gradient( 34 | center bottom, 35 | rgb(4,7,61) 54%, 36 | rgb(249,64,64) 50% 37 | ); 38 | } 39 | .noVNC_status_warn { 40 | background-color:#f0f040; 41 | background-image: -webkit-gradient( 42 | linear, 43 | left bottom, 44 | left top, 45 | color-stop(0.54, rgb(240,240,64)), 46 | color-stop(0.5, rgb(4,7,61)) 47 | ); 48 | background-image: -moz-linear-gradient( 49 | center bottom, 50 | rgb(4,7,61) 54%, 51 | rgb(240,240,64) 50% 52 | ); 53 | } 54 | 55 | .triangle-right { 56 | border:2px solid #fff; 57 | background:#04073d; 58 | color:#fff; 59 | } 60 | 61 | #keyboardinput { 62 | background-color:#04073d; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/chrome-app/tcp-client.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | Author: Boris Smus (smus@chromium.org) 17 | */ 18 | 19 | (function(exports) { 20 | 21 | // Define some local variables here. 22 | var socket = chrome.socket || chrome.experimental.socket; 23 | var dns = chrome.experimental.dns; 24 | 25 | /** 26 | * Creates an instance of the client 27 | * 28 | * @param {String} host The remote host to connect to 29 | * @param {Number} port The port to connect to at the remote host 30 | */ 31 | function TcpClient(host, port, pollInterval) { 32 | this.host = host; 33 | this.port = port; 34 | this.pollInterval = pollInterval || 15; 35 | 36 | // Callback functions. 37 | this.callbacks = { 38 | connect: null, // Called when socket is connected. 39 | disconnect: null, // Called when socket is disconnected. 40 | recvBuffer: null, // Called (as ArrayBuffer) when client receives data from server. 41 | recvString: null, // Called (as string) when client receives data from server. 42 | sent: null // Called when client sends data to server. 43 | }; 44 | 45 | // Socket. 46 | this.socketId = null; 47 | this.isConnected = false; 48 | 49 | log('initialized tcp client'); 50 | } 51 | 52 | /** 53 | * Connects to the TCP socket, and creates an open socket. 54 | * 55 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-create 56 | * @param {Function} callback The function to call on connection 57 | */ 58 | TcpClient.prototype.connect = function(callback) { 59 | // First resolve the hostname to an IP. 60 | dns.resolve(this.host, function(result) { 61 | this.addr = result.address; 62 | socket.create('tcp', {}, this._onCreate.bind(this)); 63 | 64 | // Register connect callback. 65 | this.callbacks.connect = callback; 66 | }.bind(this)); 67 | }; 68 | 69 | /** 70 | * Sends an arraybuffer/view down the wire to the remote side 71 | * 72 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-write 73 | * @param {String} msg The arraybuffer/view to send 74 | * @param {Function} callback The function to call when the message has sent 75 | */ 76 | TcpClient.prototype.sendBuffer = function(buf, callback) { 77 | if (buf.buffer) { 78 | buf = buf.buffer; 79 | } 80 | 81 | /* 82 | // Debug 83 | var bytes = [], u8 = new Uint8Array(buf); 84 | for (var i = 0; i < u8.length; i++) { 85 | bytes.push(u8[i]); 86 | } 87 | log("sending bytes: " + (bytes.join(','))); 88 | */ 89 | 90 | socket.write(this.socketId, buf, this._onWriteComplete.bind(this)); 91 | 92 | // Register sent callback. 93 | this.callbacks.sent = callback; 94 | }; 95 | 96 | /** 97 | * Sends a string down the wire to the remote side 98 | * 99 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-write 100 | * @param {String} msg The string to send 101 | * @param {Function} callback The function to call when the message has sent 102 | */ 103 | TcpClient.prototype.sendString = function(msg, callback) { 104 | /* 105 | // Debug 106 | log("sending string: " + msg); 107 | */ 108 | 109 | this._stringToArrayBuffer(msg, function(arrayBuffer) { 110 | socket.write(this.socketId, arrayBuffer, this._onWriteComplete.bind(this)); 111 | }.bind(this)); 112 | 113 | // Register sent callback. 114 | this.callbacks.sent = callback; 115 | }; 116 | 117 | /** 118 | * Sets the callback for when a message is received 119 | * 120 | * @param {Function} callback The function to call when a message has arrived 121 | * @param {String} type The callback argument type: "arraybuffer" or "string" 122 | */ 123 | TcpClient.prototype.addResponseListener = function(callback, type) { 124 | if (typeof type === "undefined") { 125 | type = "arraybuffer"; 126 | } 127 | // Register received callback. 128 | if (type === "string") { 129 | this.callbacks.recvString = callback; 130 | } else { 131 | this.callbacks.recvBuffer = callback; 132 | } 133 | }; 134 | 135 | /** 136 | * Sets the callback for when the socket disconnects 137 | * 138 | * @param {Function} callback The function to call when the socket disconnects 139 | * @param {String} type The callback argument type: "arraybuffer" or "string" 140 | */ 141 | TcpClient.prototype.addDisconnectListener = function(callback) { 142 | // Register disconnect callback. 143 | this.callbacks.disconnect = callback; 144 | }; 145 | 146 | /** 147 | * Disconnects from the remote side 148 | * 149 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-disconnect 150 | */ 151 | TcpClient.prototype.disconnect = function() { 152 | if (this.isConnected) { 153 | this.isConnected = false; 154 | socket.disconnect(this.socketId); 155 | if (this.callbacks.disconnect) { 156 | this.callbacks.disconnect(); 157 | } 158 | log('socket disconnected'); 159 | } 160 | }; 161 | 162 | /** 163 | * The callback function used for when we attempt to have Chrome 164 | * create a socket. If the socket is successfully created 165 | * we go ahead and connect to the remote side. 166 | * 167 | * @private 168 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-connect 169 | * @param {Object} createInfo The socket details 170 | */ 171 | TcpClient.prototype._onCreate = function(createInfo) { 172 | this.socketId = createInfo.socketId; 173 | if (this.socketId > 0) { 174 | socket.connect(this.socketId, this.addr, this.port, this._onConnectComplete.bind(this)); 175 | } else { 176 | error('Unable to create socket'); 177 | } 178 | }; 179 | 180 | /** 181 | * The callback function used for when we attempt to have Chrome 182 | * connect to the remote side. If a successful connection is 183 | * made then polling starts to check for data to read 184 | * 185 | * @private 186 | * @param {Number} resultCode Indicates whether the connection was successful 187 | */ 188 | TcpClient.prototype._onConnectComplete = function(resultCode) { 189 | // Start polling for reads. 190 | this.isConnected = true; 191 | setTimeout(this._periodicallyRead.bind(this), this.pollInterval); 192 | 193 | if (this.callbacks.connect) { 194 | log('connect complete'); 195 | this.callbacks.connect(); 196 | } 197 | log('onConnectComplete'); 198 | }; 199 | 200 | /** 201 | * Checks for new data to read from the socket 202 | * 203 | * @see http://developer.chrome.com/trunk/apps/socket.html#method-read 204 | */ 205 | TcpClient.prototype._periodicallyRead = function() { 206 | var that = this; 207 | socket.getInfo(this.socketId, function (info) { 208 | if (info.connected) { 209 | setTimeout(that._periodicallyRead.bind(that), that.pollInterval); 210 | socket.read(that.socketId, null, that._onDataRead.bind(that)); 211 | } else if (that.isConnected) { 212 | log('socket disconnect detected'); 213 | that.disconnect(); 214 | } 215 | }); 216 | }; 217 | 218 | /** 219 | * Callback function for when data has been read from the socket. 220 | * Converts the array buffer that is read in to a string 221 | * and sends it on for further processing by passing it to 222 | * the previously assigned callback function. 223 | * 224 | * @private 225 | * @see TcpClient.prototype.addResponseListener 226 | * @param {Object} readInfo The incoming message 227 | */ 228 | TcpClient.prototype._onDataRead = function(readInfo) { 229 | // Call received callback if there's data in the response. 230 | if (readInfo.resultCode > 0) { 231 | log('onDataRead'); 232 | 233 | /* 234 | // Debug 235 | var bytes = [], u8 = new Uint8Array(readInfo.data); 236 | for (var i = 0; i < u8.length; i++) { 237 | bytes.push(u8[i]); 238 | } 239 | log("received bytes: " + (bytes.join(','))); 240 | */ 241 | 242 | if (this.callbacks.recvBuffer) { 243 | // Return raw ArrayBuffer directly. 244 | this.callbacks.recvBuffer(readInfo.data); 245 | } 246 | if (this.callbacks.recvString) { 247 | // Convert ArrayBuffer to string. 248 | this._arrayBufferToString(readInfo.data, function(str) { 249 | this.callbacks.recvString(str); 250 | }.bind(this)); 251 | } 252 | 253 | // Trigger another read right away 254 | setTimeout(this._periodicallyRead.bind(this), 0); 255 | } 256 | }; 257 | 258 | /** 259 | * Callback for when data has been successfully 260 | * written to the socket. 261 | * 262 | * @private 263 | * @param {Object} writeInfo The outgoing message 264 | */ 265 | TcpClient.prototype._onWriteComplete = function(writeInfo) { 266 | log('onWriteComplete'); 267 | // Call sent callback. 268 | if (this.callbacks.sent) { 269 | this.callbacks.sent(writeInfo); 270 | } 271 | }; 272 | 273 | /** 274 | * Converts an array buffer to a string 275 | * 276 | * @private 277 | * @param {ArrayBuffer} buf The buffer to convert 278 | * @param {Function} callback The function to call when conversion is complete 279 | */ 280 | TcpClient.prototype._arrayBufferToString = function(buf, callback) { 281 | var bb = new Blob([new Uint8Array(buf)]); 282 | var f = new FileReader(); 283 | f.onload = function(e) { 284 | callback(e.target.result); 285 | }; 286 | f.readAsText(bb); 287 | }; 288 | 289 | /** 290 | * Converts a string to an array buffer 291 | * 292 | * @private 293 | * @param {String} str The string to convert 294 | * @param {Function} callback The function to call when conversion is complete 295 | */ 296 | TcpClient.prototype._stringToArrayBuffer = function(str, callback) { 297 | var bb = new Blob([str]); 298 | var f = new FileReader(); 299 | f.onload = function(e) { 300 | callback(e.target.result); 301 | }; 302 | f.readAsArrayBuffer(bb); 303 | }; 304 | 305 | /** 306 | * Wrapper function for logging 307 | */ 308 | function log(msg) { 309 | console.log(msg); 310 | } 311 | 312 | /** 313 | * Wrapper function for error logging 314 | */ 315 | function error(msg) { 316 | console.error(msg); 317 | } 318 | 319 | exports.TcpClient = TcpClient; 320 | 321 | })(window); 322 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/des.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Ported from Flashlight VNC ActionScript implementation: 3 | * http://www.wizhelp.com/flashlight-vnc/ 4 | * 5 | * Full attribution follows: 6 | * 7 | * ------------------------------------------------------------------------- 8 | * 9 | * This DES class has been extracted from package Acme.Crypto for use in VNC. 10 | * The unnecessary odd parity code has been removed. 11 | * 12 | * These changes are: 13 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 14 | * 15 | * This software is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | * 19 | 20 | * DesCipher - the DES encryption method 21 | * 22 | * The meat of this code is by Dave Zimmerman , and is: 23 | * 24 | * Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved. 25 | * 26 | * Permission to use, copy, modify, and distribute this software 27 | * and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and 28 | * without fee is hereby granted, provided that this copyright notice is kept 29 | * intact. 30 | * 31 | * WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY 32 | * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 33 | * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 34 | * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE 35 | * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR 36 | * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. 37 | * 38 | * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE 39 | * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE 40 | * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT 41 | * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE 42 | * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE 43 | * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE 44 | * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET WORKSHOP 45 | * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR 46 | * HIGH RISK ACTIVITIES. 47 | * 48 | * 49 | * The rest is: 50 | * 51 | * Copyright (C) 1996 by Jef Poskanzer . All rights reserved. 52 | * 53 | * Redistribution and use in source and binary forms, with or without 54 | * modification, are permitted provided that the following conditions 55 | * are met: 56 | * 1. Redistributions of source code must retain the above copyright 57 | * notice, this list of conditions and the following disclaimer. 58 | * 2. Redistributions in binary form must reproduce the above copyright 59 | * notice, this list of conditions and the following disclaimer in the 60 | * documentation and/or other materials provided with the distribution. 61 | * 62 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 63 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 64 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 65 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 66 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72 | * SUCH DAMAGE. 73 | * 74 | * Visit the ACME Labs Java page for up-to-date versions of this and other 75 | * fine Java utilities: http://www.acme.com/java/ 76 | */ 77 | 78 | /* jslint white: false */ 79 | 80 | function DES(passwd) { 81 | "use strict"; 82 | 83 | // Tables, permutations, S-boxes, etc. 84 | // jshint -W013 85 | var PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3, 86 | 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39, 87 | 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ], 88 | totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28], 89 | z = 0x0, a,b,c,d,e,f, SP1,SP2,SP3,SP4,SP5,SP6,SP7,SP8, 90 | keys = []; 91 | 92 | // jshint -W015 93 | a=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e; 94 | SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d, 95 | z|f,b|e,b|e,a|e,a|e,c|z,c|z,b|f,a|d,b|d,b|d,a|d,z|z,z|f,a|f,b|z, 96 | a|z,c|f,z|d,c|z,c|e,b|z,b|z,z|e,c|d,a|z,a|e,b|d,z|e,z|d,b|f,a|f, 97 | c|f,a|d,c|z,b|f,b|d,z|f,a|f,c|e,z|f,b|e,b|e,z|z,a|d,a|e,z|z,c|d]; 98 | a=1<<20; b=1<<31; c=a|b; d=1<<5; e=1<<15; f=d|e; 99 | SP2 = [c|f,b|e,z|e,a|f,a|z,z|d,c|d,b|f,b|d,c|f,c|e,b|z,b|e,a|z,z|d,c|d, 100 | a|e,a|d,b|f,z|z,b|z,z|e,a|f,c|z,a|d,b|d,z|z,a|e,z|f,c|e,c|z,z|f, 101 | z|z,a|f,c|d,a|z,b|f,c|z,c|e,z|e,c|z,b|e,z|d,c|f,a|f,z|d,z|e,b|z, 102 | z|f,c|e,a|z,b|d,a|d,b|f,b|d,a|d,a|e,z|z,b|e,z|f,b|z,c|d,c|f,a|e]; 103 | a=1<<17; b=1<<27; c=a|b; d=1<<3; e=1<<9; f=d|e; 104 | SP3 = [z|f,c|e,z|z,c|d,b|e,z|z,a|f,b|e,a|d,b|d,b|d,a|z,c|f,a|d,c|z,z|f, 105 | b|z,z|d,c|e,z|e,a|e,c|z,c|d,a|f,b|f,a|e,a|z,b|f,z|d,c|f,z|e,b|z, 106 | c|e,b|z,a|d,z|f,a|z,c|e,b|e,z|z,z|e,a|d,c|f,b|e,b|d,z|e,z|z,c|d, 107 | b|f,a|z,b|z,c|f,z|d,a|f,a|e,b|d,c|z,b|f,z|f,c|z,a|f,z|d,c|d,a|e]; 108 | a=1<<13; b=1<<23; c=a|b; d=1<<0; e=1<<7; f=d|e; 109 | SP4 = [c|d,a|f,a|f,z|e,c|e,b|f,b|d,a|d,z|z,c|z,c|z,c|f,z|f,z|z,b|e,b|d, 110 | z|d,a|z,b|z,c|d,z|e,b|z,a|d,a|e,b|f,z|d,a|e,b|e,a|z,c|e,c|f,z|f, 111 | b|e,b|d,c|z,c|f,z|f,z|z,z|z,c|z,a|e,b|e,b|f,z|d,c|d,a|f,a|f,z|e, 112 | c|f,z|f,z|d,a|z,b|d,a|d,c|e,b|f,a|d,a|e,b|z,c|d,z|e,b|z,a|z,c|e]; 113 | a=1<<25; b=1<<30; c=a|b; d=1<<8; e=1<<19; f=d|e; 114 | SP5 = [z|d,a|f,a|e,c|d,z|e,z|d,b|z,a|e,b|f,z|e,a|d,b|f,c|d,c|e,z|f,b|z, 115 | a|z,b|e,b|e,z|z,b|d,c|f,c|f,a|d,c|e,b|d,z|z,c|z,a|f,a|z,c|z,z|f, 116 | z|e,c|d,z|d,a|z,b|z,a|e,c|d,b|f,a|d,b|z,c|e,a|f,b|f,z|d,a|z,c|e, 117 | c|f,z|f,c|z,c|f,a|e,z|z,b|e,c|z,z|f,a|d,b|d,z|e,z|z,b|e,a|f,b|d]; 118 | a=1<<22; b=1<<29; c=a|b; d=1<<4; e=1<<14; f=d|e; 119 | SP6 = [b|d,c|z,z|e,c|f,c|z,z|d,c|f,a|z,b|e,a|f,a|z,b|d,a|d,b|e,b|z,z|f, 120 | z|z,a|d,b|f,z|e,a|e,b|f,z|d,c|d,c|d,z|z,a|f,c|e,z|f,a|e,c|e,b|z, 121 | b|e,z|d,c|d,a|e,c|f,a|z,z|f,b|d,a|z,b|e,b|z,z|f,b|d,c|f,a|e,c|z, 122 | a|f,c|e,z|z,c|d,z|d,z|e,c|z,a|f,z|e,a|d,b|f,z|z,c|e,b|z,a|d,b|f]; 123 | a=1<<21; b=1<<26; c=a|b; d=1<<1; e=1<<11; f=d|e; 124 | SP7 = [a|z,c|d,b|f,z|z,z|e,b|f,a|f,c|e,c|f,a|z,z|z,b|d,z|d,b|z,c|d,z|f, 125 | b|e,a|f,a|d,b|e,b|d,c|z,c|e,a|d,c|z,z|e,z|f,c|f,a|e,z|d,b|z,a|e, 126 | b|z,a|e,a|z,b|f,b|f,c|d,c|d,z|d,a|d,b|z,b|e,a|z,c|e,z|f,a|f,c|e, 127 | z|f,b|d,c|f,c|z,a|e,z|z,z|d,c|f,z|z,a|f,c|z,z|e,b|d,b|e,z|e,a|d]; 128 | a=1<<18; b=1<<28; c=a|b; d=1<<6; e=1<<12; f=d|e; 129 | SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d, 130 | c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z, 131 | a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f, 132 | z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e]; 133 | // jshint +W013,+W015 134 | 135 | // Set the key. 136 | function setKeys(keyBlock) { 137 | var i, j, l, m, n, o, pc1m = [], pcr = [], kn = [], 138 | raw0, raw1, rawi, KnLi; 139 | 140 | for (j = 0, l = 56; j < 56; ++j, l -= 8) { 141 | l += l < -5 ? 65 : l < -3 ? 31 : l < -1 ? 63 : l === 27 ? 35 : 0; // PC1 142 | m = l & 0x7; 143 | pc1m[j] = ((keyBlock[l >>> 3] & (1<>> 10; 177 | keys[KnLi] |= (raw1 & 0x00000fc0) >>> 6; 178 | ++KnLi; 179 | keys[KnLi] = (raw0 & 0x0003f000) << 12; 180 | keys[KnLi] |= (raw0 & 0x0000003f) << 16; 181 | keys[KnLi] |= (raw1 & 0x0003f000) >>> 4; 182 | keys[KnLi] |= (raw1 & 0x0000003f); 183 | ++KnLi; 184 | } 185 | } 186 | 187 | // Encrypt 8 bytes of text 188 | function enc8(text) { 189 | var i = 0, b = text.slice(), fval, keysi = 0, 190 | l, r, x; // left, right, accumulator 191 | 192 | // Squash 8 bytes to 2 ints 193 | l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++]; 194 | r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++]; 195 | 196 | x = ((l >>> 4) ^ r) & 0x0f0f0f0f; 197 | r ^= x; 198 | l ^= (x << 4); 199 | x = ((l >>> 16) ^ r) & 0x0000ffff; 200 | r ^= x; 201 | l ^= (x << 16); 202 | x = ((r >>> 2) ^ l) & 0x33333333; 203 | l ^= x; 204 | r ^= (x << 2); 205 | x = ((r >>> 8) ^ l) & 0x00ff00ff; 206 | l ^= x; 207 | r ^= (x << 8); 208 | r = (r << 1) | ((r >>> 31) & 1); 209 | x = (l ^ r) & 0xaaaaaaaa; 210 | l ^= x; 211 | r ^= x; 212 | l = (l << 1) | ((l >>> 31) & 1); 213 | 214 | for (i = 0; i < 8; ++i) { 215 | x = (r << 28) | (r >>> 4); 216 | x ^= keys[keysi++]; 217 | fval = SP7[x & 0x3f]; 218 | fval |= SP5[(x >>> 8) & 0x3f]; 219 | fval |= SP3[(x >>> 16) & 0x3f]; 220 | fval |= SP1[(x >>> 24) & 0x3f]; 221 | x = r ^ keys[keysi++]; 222 | fval |= SP8[x & 0x3f]; 223 | fval |= SP6[(x >>> 8) & 0x3f]; 224 | fval |= SP4[(x >>> 16) & 0x3f]; 225 | fval |= SP2[(x >>> 24) & 0x3f]; 226 | l ^= fval; 227 | x = (l << 28) | (l >>> 4); 228 | x ^= keys[keysi++]; 229 | fval = SP7[x & 0x3f]; 230 | fval |= SP5[(x >>> 8) & 0x3f]; 231 | fval |= SP3[(x >>> 16) & 0x3f]; 232 | fval |= SP1[(x >>> 24) & 0x3f]; 233 | x = l ^ keys[keysi++]; 234 | fval |= SP8[x & 0x0000003f]; 235 | fval |= SP6[(x >>> 8) & 0x3f]; 236 | fval |= SP4[(x >>> 16) & 0x3f]; 237 | fval |= SP2[(x >>> 24) & 0x3f]; 238 | r ^= fval; 239 | } 240 | 241 | r = (r << 31) | (r >>> 1); 242 | x = (l ^ r) & 0xaaaaaaaa; 243 | l ^= x; 244 | r ^= x; 245 | l = (l << 31) | (l >>> 1); 246 | x = ((l >>> 8) ^ r) & 0x00ff00ff; 247 | r ^= x; 248 | l ^= (x << 8); 249 | x = ((l >>> 2) ^ r) & 0x33333333; 250 | r ^= x; 251 | l ^= (x << 2); 252 | x = ((r >>> 16) ^ l) & 0x0000ffff; 253 | l ^= x; 254 | r ^= (x << 16); 255 | x = ((r >>> 4) ^ l) & 0x0f0f0f0f; 256 | l ^= x; 257 | r ^= (x << 4); 258 | 259 | // Spread ints to bytes 260 | x = [r, l]; 261 | for (i = 0; i < 8; i++) { 262 | b[i] = (x[i>>>2] >>> (8 * (3 - (i % 4)))) % 256; 263 | if (b[i] < 0) { b[i] += 256; } // unsigned 264 | } 265 | return b; 266 | } 267 | 268 | // Encrypt 16 bytes of text using passwd as key 269 | function encrypt(t) { 270 | return enc8(t.slice(0, 8)).concat(enc8(t.slice(8, 16))); 271 | } 272 | 273 | setKeys(passwd); // Setup keys 274 | return {'encrypt': encrypt}; // Public interface 275 | 276 | } // function DES 277 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/input.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 Samuel Mannehed for Cendio AB 5 | * Licensed under MPL 2.0 or any later version (see LICENSE.txt) 6 | */ 7 | 8 | /*jslint browser: true, white: false */ 9 | /*global window, Util */ 10 | 11 | var Keyboard, Mouse; 12 | 13 | (function () { 14 | "use strict"; 15 | 16 | // 17 | // Keyboard event handler 18 | // 19 | 20 | Keyboard = function (defaults) { 21 | this._keyDownList = []; // List of depressed keys 22 | // (even if they are happy) 23 | 24 | Util.set_defaults(this, defaults, { 25 | 'target': document, 26 | 'focused': true 27 | }); 28 | 29 | // create the keyboard handler 30 | this._handler = new KeyEventDecoder(kbdUtil.ModifierSync(), 31 | VerifyCharModifier( /* jshint newcap: false */ 32 | TrackKeyState( 33 | EscapeModifiers(this._handleRfbEvent.bind(this)) 34 | ) 35 | ) 36 | ); /* jshint newcap: true */ 37 | 38 | // keep these here so we can refer to them later 39 | this._eventHandlers = { 40 | 'keyup': this._handleKeyUp.bind(this), 41 | 'keydown': this._handleKeyDown.bind(this), 42 | 'keypress': this._handleKeyPress.bind(this), 43 | 'blur': this._allKeysUp.bind(this) 44 | }; 45 | }; 46 | 47 | Keyboard.prototype = { 48 | // private methods 49 | 50 | _handleRfbEvent: function (e) { 51 | if (this._onKeyPress) { 52 | Util.Debug("onKeyPress " + (e.type == 'keydown' ? "down" : "up") + 53 | ", keysym: " + e.keysym.keysym + "(" + e.keysym.keyname + ")"); 54 | this._onKeyPress(e.keysym.keysym, e.type == 'keydown'); 55 | } 56 | }, 57 | 58 | _handleKeyDown: function (e) { 59 | if (!this._focused) { return true; } 60 | 61 | if (this._handler.keydown(e)) { 62 | // Suppress bubbling/default actions 63 | Util.stopEvent(e); 64 | return false; 65 | } else { 66 | // Allow the event to bubble and become a keyPress event which 67 | // will have the character code translated 68 | return true; 69 | } 70 | }, 71 | 72 | _handleKeyPress: function (e) { 73 | if (!this._focused) { return true; } 74 | 75 | if (this._handler.keypress(e)) { 76 | // Suppress bubbling/default actions 77 | Util.stopEvent(e); 78 | return false; 79 | } else { 80 | // Allow the event to bubble and become a keyPress event which 81 | // will have the character code translated 82 | return true; 83 | } 84 | }, 85 | 86 | _handleKeyUp: function (e) { 87 | if (!this._focused) { return true; } 88 | 89 | if (this._handler.keyup(e)) { 90 | // Suppress bubbling/default actions 91 | Util.stopEvent(e); 92 | return false; 93 | } else { 94 | // Allow the event to bubble and become a keyPress event which 95 | // will have the character code translated 96 | return true; 97 | } 98 | }, 99 | 100 | _allKeysUp: function () { 101 | Util.Debug(">> Keyboard.allKeysUp"); 102 | this._handler.releaseAll(); 103 | Util.Debug("<< Keyboard.allKeysUp"); 104 | }, 105 | 106 | // Public methods 107 | 108 | grab: function () { 109 | //Util.Debug(">> Keyboard.grab"); 110 | var c = this._target; 111 | 112 | Util.addEvent(c, 'keydown', this._eventHandlers.keydown); 113 | Util.addEvent(c, 'keyup', this._eventHandlers.keyup); 114 | Util.addEvent(c, 'keypress', this._eventHandlers.keypress); 115 | 116 | // Release (key up) if window loses focus 117 | Util.addEvent(window, 'blur', this._eventHandlers.blur); 118 | 119 | //Util.Debug("<< Keyboard.grab"); 120 | }, 121 | 122 | ungrab: function () { 123 | //Util.Debug(">> Keyboard.ungrab"); 124 | var c = this._target; 125 | 126 | Util.removeEvent(c, 'keydown', this._eventHandlers.keydown); 127 | Util.removeEvent(c, 'keyup', this._eventHandlers.keyup); 128 | Util.removeEvent(c, 'keypress', this._eventHandlers.keypress); 129 | Util.removeEvent(window, 'blur', this._eventHandlers.blur); 130 | 131 | // Release (key up) all keys that are in a down state 132 | this._allKeysUp(); 133 | 134 | //Util.Debug(">> Keyboard.ungrab"); 135 | }, 136 | 137 | sync: function (e) { 138 | this._handler.syncModifiers(e); 139 | } 140 | }; 141 | 142 | Util.make_properties(Keyboard, [ 143 | ['target', 'wo', 'dom'], // DOM element that captures keyboard input 144 | ['focused', 'rw', 'bool'], // Capture and send key events 145 | 146 | ['onKeyPress', 'rw', 'func'] // Handler for key press/release 147 | ]); 148 | 149 | // 150 | // Mouse event handler 151 | // 152 | 153 | Mouse = function (defaults) { 154 | this._mouseCaptured = false; 155 | 156 | this._doubleClickTimer = null; 157 | this._lastTouchPos = null; 158 | 159 | // Configuration attributes 160 | Util.set_defaults(this, defaults, { 161 | 'target': document, 162 | 'focused': true, 163 | 'scale': 1.0, 164 | 'touchButton': 1 165 | }); 166 | 167 | this._eventHandlers = { 168 | 'mousedown': this._handleMouseDown.bind(this), 169 | 'mouseup': this._handleMouseUp.bind(this), 170 | 'mousemove': this._handleMouseMove.bind(this), 171 | 'mousewheel': this._handleMouseWheel.bind(this), 172 | 'mousedisable': this._handleMouseDisable.bind(this) 173 | }; 174 | }; 175 | 176 | Mouse.prototype = { 177 | // private methods 178 | _captureMouse: function () { 179 | // capturing the mouse ensures we get the mouseup event 180 | if (this._target.setCapture) { 181 | this._target.setCapture(); 182 | } 183 | 184 | // some browsers give us mouseup events regardless, 185 | // so if we never captured the mouse, we can disregard the event 186 | this._mouseCaptured = true; 187 | }, 188 | 189 | _releaseMouse: function () { 190 | if (this._target.releaseCapture) { 191 | this._target.releaseCapture(); 192 | } 193 | this._mouseCaptured = false; 194 | }, 195 | 196 | _resetDoubleClickTimer: function () { 197 | this._doubleClickTimer = null; 198 | }, 199 | 200 | _handleMouseButton: function (e, down) { 201 | if (!this._focused) { return true; } 202 | 203 | if (this._notify) { 204 | this._notify(e); 205 | } 206 | 207 | var evt = (e ? e : window.event); 208 | var pos = Util.getEventPosition(e, this._target, this._scale); 209 | 210 | var bmask; 211 | if (e.touches || e.changedTouches) { 212 | // Touch device 213 | 214 | // When two touches occur within 500 ms of each other and are 215 | // closer than 20 pixels together a double click is triggered. 216 | if (down == 1) { 217 | if (this._doubleClickTimer === null) { 218 | this._lastTouchPos = pos; 219 | } else { 220 | clearTimeout(this._doubleClickTimer); 221 | 222 | // When the distance between the two touches is small enough 223 | // force the position of the latter touch to the position of 224 | // the first. 225 | 226 | var xs = this._lastTouchPos.x - pos.x; 227 | var ys = this._lastTouchPos.y - pos.y; 228 | var d = Math.sqrt((xs * xs) + (ys * ys)); 229 | 230 | // The goal is to trigger on a certain physical width, the 231 | // devicePixelRatio brings us a bit closer but is not optimal. 232 | if (d < 20 * window.devicePixelRatio) { 233 | pos = this._lastTouchPos; 234 | } 235 | } 236 | this._doubleClickTimer = setTimeout(this._resetDoubleClickTimer.bind(this), 500); 237 | } 238 | bmask = this._touchButton; 239 | // If bmask is set 240 | } else if (evt.which) { 241 | /* everything except IE */ 242 | bmask = 1 << evt.button; 243 | } else { 244 | /* IE including 9 */ 245 | bmask = (evt.button & 0x1) + // Left 246 | (evt.button & 0x2) * 2 + // Right 247 | (evt.button & 0x4) / 2; // Middle 248 | } 249 | 250 | if (this._onMouseButton) { 251 | Util.Debug("onMouseButton " + (down ? "down" : "up") + 252 | ", x: " + pos.x + ", y: " + pos.y + ", bmask: " + bmask); 253 | this._onMouseButton(pos.x, pos.y, down, bmask); 254 | } 255 | Util.stopEvent(e); 256 | return false; 257 | }, 258 | 259 | _handleMouseDown: function (e) { 260 | this._captureMouse(); 261 | this._handleMouseButton(e, 1); 262 | }, 263 | 264 | _handleMouseUp: function (e) { 265 | if (!this._mouseCaptured) { return; } 266 | 267 | this._handleMouseButton(e, 0); 268 | this._releaseMouse(); 269 | }, 270 | 271 | _handleMouseWheel: function (e) { 272 | if (!this._focused) { return true; } 273 | 274 | if (this._notify) { 275 | this._notify(e); 276 | } 277 | 278 | var evt = (e ? e : window.event); 279 | var pos = Util.getEventPosition(e, this._target, this._scale); 280 | var wheelData = evt.detail ? evt.detail * -1 : evt.wheelDelta / 40; 281 | var bmask; 282 | if (wheelData > 0) { 283 | bmask = 1 << 3; 284 | } else { 285 | bmask = 1 << 4; 286 | } 287 | 288 | if (this._onMouseButton) { 289 | this._onMouseButton(pos.x, pos.y, 1, bmask); 290 | this._onMouseButton(pos.x, pos.y, 0, bmask); 291 | } 292 | Util.stopEvent(e); 293 | return false; 294 | }, 295 | 296 | _handleMouseMove: function (e) { 297 | if (! this._focused) { return true; } 298 | 299 | if (this._notify) { 300 | this._notify(e); 301 | } 302 | 303 | var evt = (e ? e : window.event); 304 | var pos = Util.getEventPosition(e, this._target, this._scale); 305 | if (this._onMouseMove) { 306 | this._onMouseMove(pos.x, pos.y); 307 | } 308 | Util.stopEvent(e); 309 | return false; 310 | }, 311 | 312 | _handleMouseDisable: function (e) { 313 | if (!this._focused) { return true; } 314 | 315 | var evt = (e ? e : window.event); 316 | var pos = Util.getEventPosition(e, this._target, this._scale); 317 | 318 | /* Stop propagation if inside canvas area */ 319 | if ((pos.realx >= 0) && (pos.realy >= 0) && 320 | (pos.realx < this._target.offsetWidth) && 321 | (pos.realy < this._target.offsetHeight)) { 322 | //Util.Debug("mouse event disabled"); 323 | Util.stopEvent(e); 324 | return false; 325 | } 326 | 327 | return true; 328 | }, 329 | 330 | 331 | // Public methods 332 | grab: function () { 333 | var c = this._target; 334 | 335 | if ('ontouchstart' in document.documentElement) { 336 | Util.addEvent(c, 'touchstart', this._eventHandlers.mousedown); 337 | Util.addEvent(window, 'touchend', this._eventHandlers.mouseup); 338 | Util.addEvent(c, 'touchend', this._eventHandlers.mouseup); 339 | Util.addEvent(c, 'touchmove', this._eventHandlers.mousemove); 340 | } else { 341 | Util.addEvent(c, 'mousedown', this._eventHandlers.mousedown); 342 | Util.addEvent(window, 'mouseup', this._eventHandlers.mouseup); 343 | Util.addEvent(c, 'mouseup', this._eventHandlers.mouseup); 344 | Util.addEvent(c, 'mousemove', this._eventHandlers.mousemove); 345 | Util.addEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', 346 | this._eventHandlers.mousewheel); 347 | } 348 | 349 | /* Work around right and middle click browser behaviors */ 350 | Util.addEvent(document, 'click', this._eventHandlers.mousedisable); 351 | Util.addEvent(document.body, 'contextmenu', this._eventHandlers.mousedisable); 352 | }, 353 | 354 | ungrab: function () { 355 | var c = this._target; 356 | 357 | if ('ontouchstart' in document.documentElement) { 358 | Util.removeEvent(c, 'touchstart', this._eventHandlers.mousedown); 359 | Util.removeEvent(window, 'touchend', this._eventHandlers.mouseup); 360 | Util.removeEvent(c, 'touchend', this._eventHandlers.mouseup); 361 | Util.removeEvent(c, 'touchmove', this._eventHandlers.mousemove); 362 | } else { 363 | Util.removeEvent(c, 'mousedown', this._eventHandlers.mousedown); 364 | Util.removeEvent(window, 'mouseup', this._eventHandlers.mouseup); 365 | Util.removeEvent(c, 'mouseup', this._eventHandlers.mouseup); 366 | Util.removeEvent(c, 'mousemove', this._eventHandlers.mousemove); 367 | Util.removeEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', 368 | this._eventHandlers.mousewheel); 369 | } 370 | 371 | /* Work around right and middle click browser behaviors */ 372 | Util.removeEvent(document, 'click', this._eventHandlers.mousedisable); 373 | Util.removeEvent(document.body, 'contextmenu', this._eventHandlers.mousedisable); 374 | 375 | } 376 | }; 377 | 378 | Util.make_properties(Mouse, [ 379 | ['target', 'ro', 'dom'], // DOM element that captures mouse input 380 | ['notify', 'ro', 'func'], // Function to call to notify whenever a mouse event is received 381 | ['focused', 'rw', 'bool'], // Capture and send mouse clicks/movement 382 | ['scale', 'rw', 'float'], // Viewport scale factor 0.0 - 1.0 383 | 384 | ['onMouseButton', 'rw', 'func'], // Handler for mouse button click/release 385 | ['onMouseMove', 'rw', 'func'], // Handler for mouse movement 386 | ['touchButton', 'rw', 'int'] // Button mask (1, 2, 4) for touch devices (0 means ignore clicks) 387 | ]); 388 | })(); 389 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/keysymdef.js: -------------------------------------------------------------------------------- 1 | // This file describes mappings from Unicode codepoints to the keysym values 2 | // (and optionally, key names) expected by the RFB protocol 3 | // How this file was generated: 4 | // node /Users/jalf/dev/mi/novnc/utils/parse.js /opt/X11/include/X11/keysymdef.h 5 | var keysyms = (function(){ 6 | "use strict"; 7 | var keynames = null; 8 | var codepoints = {"32":32,"33":33,"34":34,"35":35,"36":36,"37":37,"38":38,"39":39,"40":40,"41":41,"42":42,"43":43,"44":44,"45":45,"46":46,"47":47,"48":48,"49":49,"50":50,"51":51,"52":52,"53":53,"54":54,"55":55,"56":56,"57":57,"58":58,"59":59,"60":60,"61":61,"62":62,"63":63,"64":64,"65":65,"66":66,"67":67,"68":68,"69":69,"70":70,"71":71,"72":72,"73":73,"74":74,"75":75,"76":76,"77":77,"78":78,"79":79,"80":80,"81":81,"82":82,"83":83,"84":84,"85":85,"86":86,"87":87,"88":88,"89":89,"90":90,"91":91,"92":92,"93":93,"94":94,"95":95,"96":96,"97":97,"98":98,"99":99,"100":100,"101":101,"102":102,"103":103,"104":104,"105":105,"106":106,"107":107,"108":108,"109":109,"110":110,"111":111,"112":112,"113":113,"114":114,"115":115,"116":116,"117":117,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"160":160,"161":161,"162":162,"163":163,"164":164,"165":165,"166":166,"167":167,"168":168,"169":169,"170":170,"171":171,"172":172,"173":173,"174":174,"175":175,"176":176,"177":177,"178":178,"179":179,"180":180,"181":181,"182":182,"183":183,"184":184,"185":185,"186":186,"187":187,"188":188,"189":189,"190":190,"191":191,"192":192,"193":193,"194":194,"195":195,"196":196,"197":197,"198":198,"199":199,"200":200,"201":201,"202":202,"203":203,"204":204,"205":205,"206":206,"207":207,"208":208,"209":209,"210":210,"211":211,"212":212,"213":213,"214":214,"215":215,"216":216,"217":217,"218":218,"219":219,"220":220,"221":221,"222":222,"223":223,"224":224,"225":225,"226":226,"227":227,"228":228,"229":229,"230":230,"231":231,"232":232,"233":233,"234":234,"235":235,"236":236,"237":237,"238":238,"239":239,"240":240,"241":241,"242":242,"243":243,"244":244,"245":245,"246":246,"247":247,"248":248,"249":249,"250":250,"251":251,"252":252,"253":253,"254":254,"255":255,"256":960,"257":992,"258":451,"259":483,"260":417,"261":433,"262":454,"263":486,"264":710,"265":742,"266":709,"267":741,"268":456,"269":488,"270":463,"271":495,"272":464,"273":496,"274":938,"275":954,"278":972,"279":1004,"280":458,"281":490,"282":460,"283":492,"284":728,"285":760,"286":683,"287":699,"288":725,"289":757,"290":939,"291":955,"292":678,"293":694,"294":673,"295":689,"296":933,"297":949,"298":975,"299":1007,"300":16777516,"301":16777517,"302":967,"303":999,"304":681,"305":697,"308":684,"309":700,"310":979,"311":1011,"312":930,"313":453,"314":485,"315":934,"316":950,"317":421,"318":437,"321":419,"322":435,"323":465,"324":497,"325":977,"326":1009,"327":466,"328":498,"330":957,"331":959,"332":978,"333":1010,"336":469,"337":501,"338":5052,"339":5053,"340":448,"341":480,"342":931,"343":947,"344":472,"345":504,"346":422,"347":438,"348":734,"349":766,"350":426,"351":442,"352":425,"353":441,"354":478,"355":510,"356":427,"357":443,"358":940,"359":956,"360":989,"361":1021,"362":990,"363":1022,"364":733,"365":765,"366":473,"367":505,"368":475,"369":507,"370":985,"371":1017,"372":16777588,"373":16777589,"374":16777590,"375":16777591,"376":5054,"377":428,"378":444,"379":431,"380":447,"381":430,"382":446,"399":16777615,"402":2294,"415":16777631,"416":16777632,"417":16777633,"431":16777647,"432":16777648,"437":16777653,"438":16777654,"439":16777655,"466":16777681,"486":16777702,"487":16777703,"601":16777817,"629":16777845,"658":16777874,"711":439,"728":418,"729":511,"731":434,"733":445,"901":1966,"902":1953,"904":1954,"905":1955,"906":1956,"908":1959,"910":1960,"911":1963,"912":1974,"913":1985,"914":1986,"915":1987,"916":1988,"917":1989,"918":1990,"919":1991,"920":1992,"921":1993,"922":1994,"923":1995,"924":1996,"925":1997,"926":1998,"927":1999,"928":2000,"929":2001,"931":2002,"932":2004,"933":2005,"934":2006,"935":2007,"936":2008,"937":2009,"938":1957,"939":1961,"940":1969,"941":1970,"942":1971,"943":1972,"944":1978,"945":2017,"946":2018,"947":2019,"948":2020,"949":2021,"950":2022,"951":2023,"952":2024,"953":2025,"954":2026,"955":2027,"956":2028,"957":2029,"958":2030,"959":2031,"960":2032,"961":2033,"962":2035,"963":2034,"964":2036,"965":2037,"966":2038,"967":2039,"968":2040,"969":2041,"970":1973,"971":1977,"972":1975,"973":1976,"974":1979,"1025":1715,"1026":1713,"1027":1714,"1028":1716,"1029":1717,"1030":1718,"1031":1719,"1032":1720,"1033":1721,"1034":1722,"1035":1723,"1036":1724,"1038":1726,"1039":1727,"1040":1761,"1041":1762,"1042":1783,"1043":1767,"1044":1764,"1045":1765,"1046":1782,"1047":1786,"1048":1769,"1049":1770,"1050":1771,"1051":1772,"1052":1773,"1053":1774,"1054":1775,"1055":1776,"1056":1778,"1057":1779,"1058":1780,"1059":1781,"1060":1766,"1061":1768,"1062":1763,"1063":1790,"1064":1787,"1065":1789,"1066":1791,"1067":1785,"1068":1784,"1069":1788,"1070":1760,"1071":1777,"1072":1729,"1073":1730,"1074":1751,"1075":1735,"1076":1732,"1077":1733,"1078":1750,"1079":1754,"1080":1737,"1081":1738,"1082":1739,"1083":1740,"1084":1741,"1085":1742,"1086":1743,"1087":1744,"1088":1746,"1089":1747,"1090":1748,"1091":1749,"1092":1734,"1093":1736,"1094":1731,"1095":1758,"1096":1755,"1097":1757,"1098":1759,"1099":1753,"1100":1752,"1101":1756,"1102":1728,"1103":1745,"1105":1699,"1106":1697,"1107":1698,"1108":1700,"1109":1701,"1110":1702,"1111":1703,"1112":1704,"1113":1705,"1114":1706,"1115":1707,"1116":1708,"1118":1710,"1119":1711,"1168":1725,"1169":1709,"1170":16778386,"1171":16778387,"1174":16778390,"1175":16778391,"1178":16778394,"1179":16778395,"1180":16778396,"1181":16778397,"1186":16778402,"1187":16778403,"1198":16778414,"1199":16778415,"1200":16778416,"1201":16778417,"1202":16778418,"1203":16778419,"1206":16778422,"1207":16778423,"1208":16778424,"1209":16778425,"1210":16778426,"1211":16778427,"1240":16778456,"1241":16778457,"1250":16778466,"1251":16778467,"1256":16778472,"1257":16778473,"1262":16778478,"1263":16778479,"1329":16778545,"1330":16778546,"1331":16778547,"1332":16778548,"1333":16778549,"1334":16778550,"1335":16778551,"1336":16778552,"1337":16778553,"1338":16778554,"1339":16778555,"1340":16778556,"1341":16778557,"1342":16778558,"1343":16778559,"1344":16778560,"1345":16778561,"1346":16778562,"1347":16778563,"1348":16778564,"1349":16778565,"1350":16778566,"1351":16778567,"1352":16778568,"1353":16778569,"1354":16778570,"1355":16778571,"1356":16778572,"1357":16778573,"1358":16778574,"1359":16778575,"1360":16778576,"1361":16778577,"1362":16778578,"1363":16778579,"1364":16778580,"1365":16778581,"1366":16778582,"1370":16778586,"1371":16778587,"1372":16778588,"1373":16778589,"1374":16778590,"1377":16778593,"1378":16778594,"1379":16778595,"1380":16778596,"1381":16778597,"1382":16778598,"1383":16778599,"1384":16778600,"1385":16778601,"1386":16778602,"1387":16778603,"1388":16778604,"1389":16778605,"1390":16778606,"1391":16778607,"1392":16778608,"1393":16778609,"1394":16778610,"1395":16778611,"1396":16778612,"1397":16778613,"1398":16778614,"1399":16778615,"1400":16778616,"1401":16778617,"1402":16778618,"1403":16778619,"1404":16778620,"1405":16778621,"1406":16778622,"1407":16778623,"1408":16778624,"1409":16778625,"1410":16778626,"1411":16778627,"1412":16778628,"1413":16778629,"1414":16778630,"1415":16778631,"1417":16778633,"1418":16778634,"1488":3296,"1489":3297,"1490":3298,"1491":3299,"1492":3300,"1493":3301,"1494":3302,"1495":3303,"1496":3304,"1497":3305,"1498":3306,"1499":3307,"1500":3308,"1501":3309,"1502":3310,"1503":3311,"1504":3312,"1505":3313,"1506":3314,"1507":3315,"1508":3316,"1509":3317,"1510":3318,"1511":3319,"1512":3320,"1513":3321,"1514":3322,"1548":1452,"1563":1467,"1567":1471,"1569":1473,"1570":1474,"1571":1475,"1572":1476,"1573":1477,"1574":1478,"1575":1479,"1576":1480,"1577":1481,"1578":1482,"1579":1483,"1580":1484,"1581":1485,"1582":1486,"1583":1487,"1584":1488,"1585":1489,"1586":1490,"1587":1491,"1588":1492,"1589":1493,"1590":1494,"1591":1495,"1592":1496,"1593":1497,"1594":1498,"1600":1504,"1601":1505,"1602":1506,"1603":1507,"1604":1508,"1605":1509,"1606":1510,"1607":1511,"1608":1512,"1609":1513,"1610":1514,"1611":1515,"1612":1516,"1613":1517,"1614":1518,"1615":1519,"1616":1520,"1617":1521,"1618":1522,"1619":16778835,"1620":16778836,"1621":16778837,"1632":16778848,"1633":16778849,"1634":16778850,"1635":16778851,"1636":16778852,"1637":16778853,"1638":16778854,"1639":16778855,"1640":16778856,"1641":16778857,"1642":16778858,"1648":16778864,"1657":16778873,"1662":16778878,"1670":16778886,"1672":16778888,"1681":16778897,"1688":16778904,"1700":16778916,"1705":16778921,"1711":16778927,"1722":16778938,"1726":16778942,"1729":16778945,"1740":16778956,"1746":16778962,"1748":16778964,"1776":16778992,"1777":16778993,"1778":16778994,"1779":16778995,"1780":16778996,"1781":16778997,"1782":16778998,"1783":16778999,"1784":16779000,"1785":16779001,"3458":16780674,"3459":16780675,"3461":16780677,"3462":16780678,"3463":16780679,"3464":16780680,"3465":16780681,"3466":16780682,"3467":16780683,"3468":16780684,"3469":16780685,"3470":16780686,"3471":16780687,"3472":16780688,"3473":16780689,"3474":16780690,"3475":16780691,"3476":16780692,"3477":16780693,"3478":16780694,"3482":16780698,"3483":16780699,"3484":16780700,"3485":16780701,"3486":16780702,"3487":16780703,"3488":16780704,"3489":16780705,"3490":16780706,"3491":16780707,"3492":16780708,"3493":16780709,"3494":16780710,"3495":16780711,"3496":16780712,"3497":16780713,"3498":16780714,"3499":16780715,"3500":16780716,"3501":16780717,"3502":16780718,"3503":16780719,"3504":16780720,"3505":16780721,"3507":16780723,"3508":16780724,"3509":16780725,"3510":16780726,"3511":16780727,"3512":16780728,"3513":16780729,"3514":16780730,"3515":16780731,"3517":16780733,"3520":16780736,"3521":16780737,"3522":16780738,"3523":16780739,"3524":16780740,"3525":16780741,"3526":16780742,"3530":16780746,"3535":16780751,"3536":16780752,"3537":16780753,"3538":16780754,"3539":16780755,"3540":16780756,"3542":16780758,"3544":16780760,"3545":16780761,"3546":16780762,"3547":16780763,"3548":16780764,"3549":16780765,"3550":16780766,"3551":16780767,"3570":16780786,"3571":16780787,"3572":16780788,"3585":3489,"3586":3490,"3587":3491,"3588":3492,"3589":3493,"3590":3494,"3591":3495,"3592":3496,"3593":3497,"3594":3498,"3595":3499,"3596":3500,"3597":3501,"3598":3502,"3599":3503,"3600":3504,"3601":3505,"3602":3506,"3603":3507,"3604":3508,"3605":3509,"3606":3510,"3607":3511,"3608":3512,"3609":3513,"3610":3514,"3611":3515,"3612":3516,"3613":3517,"3614":3518,"3615":3519,"3616":3520,"3617":3521,"3618":3522,"3619":3523,"3620":3524,"3621":3525,"3622":3526,"3623":3527,"3624":3528,"3625":3529,"3626":3530,"3627":3531,"3628":3532,"3629":3533,"3630":3534,"3631":3535,"3632":3536,"3633":3537,"3634":3538,"3635":3539,"3636":3540,"3637":3541,"3638":3542,"3639":3543,"3640":3544,"3641":3545,"3642":3546,"3647":3551,"3648":3552,"3649":3553,"3650":3554,"3651":3555,"3652":3556,"3653":3557,"3654":3558,"3655":3559,"3656":3560,"3657":3561,"3658":3562,"3659":3563,"3660":3564,"3661":3565,"3664":3568,"3665":3569,"3666":3570,"3667":3571,"3668":3572,"3669":3573,"3670":3574,"3671":3575,"3672":3576,"3673":3577,"4304":16781520,"4305":16781521,"4306":16781522,"4307":16781523,"4308":16781524,"4309":16781525,"4310":16781526,"4311":16781527,"4312":16781528,"4313":16781529,"4314":16781530,"4315":16781531,"4316":16781532,"4317":16781533,"4318":16781534,"4319":16781535,"4320":16781536,"4321":16781537,"4322":16781538,"4323":16781539,"4324":16781540,"4325":16781541,"4326":16781542,"4327":16781543,"4328":16781544,"4329":16781545,"4330":16781546,"4331":16781547,"4332":16781548,"4333":16781549,"4334":16781550,"4335":16781551,"4336":16781552,"4337":16781553,"4338":16781554,"4339":16781555,"4340":16781556,"4341":16781557,"4342":16781558,"7682":16784898,"7683":16784899,"7690":16784906,"7691":16784907,"7710":16784926,"7711":16784927,"7734":16784950,"7735":16784951,"7744":16784960,"7745":16784961,"7766":16784982,"7767":16784983,"7776":16784992,"7777":16784993,"7786":16785002,"7787":16785003,"7808":16785024,"7809":16785025,"7810":16785026,"7811":16785027,"7812":16785028,"7813":16785029,"7818":16785034,"7819":16785035,"7840":16785056,"7841":16785057,"7842":16785058,"7843":16785059,"7844":16785060,"7845":16785061,"7846":16785062,"7847":16785063,"7848":16785064,"7849":16785065,"7850":16785066,"7851":16785067,"7852":16785068,"7853":16785069,"7854":16785070,"7855":16785071,"7856":16785072,"7857":16785073,"7858":16785074,"7859":16785075,"7860":16785076,"7861":16785077,"7862":16785078,"7863":16785079,"7864":16785080,"7865":16785081,"7866":16785082,"7867":16785083,"7868":16785084,"7869":16785085,"7870":16785086,"7871":16785087,"7872":16785088,"7873":16785089,"7874":16785090,"7875":16785091,"7876":16785092,"7877":16785093,"7878":16785094,"7879":16785095,"7880":16785096,"7881":16785097,"7882":16785098,"7883":16785099,"7884":16785100,"7885":16785101,"7886":16785102,"7887":16785103,"7888":16785104,"7889":16785105,"7890":16785106,"7891":16785107,"7892":16785108,"7893":16785109,"7894":16785110,"7895":16785111,"7896":16785112,"7897":16785113,"7898":16785114,"7899":16785115,"7900":16785116,"7901":16785117,"7902":16785118,"7903":16785119,"7904":16785120,"7905":16785121,"7906":16785122,"7907":16785123,"7908":16785124,"7909":16785125,"7910":16785126,"7911":16785127,"7912":16785128,"7913":16785129,"7914":16785130,"7915":16785131,"7916":16785132,"7917":16785133,"7918":16785134,"7919":16785135,"7920":16785136,"7921":16785137,"7922":16785138,"7923":16785139,"7924":16785140,"7925":16785141,"7926":16785142,"7927":16785143,"7928":16785144,"7929":16785145,"8194":2722,"8195":2721,"8196":2723,"8197":2724,"8199":2725,"8200":2726,"8201":2727,"8202":2728,"8210":2747,"8211":2730,"8212":2729,"8213":1967,"8215":3295,"8216":2768,"8217":2769,"8218":2813,"8220":2770,"8221":2771,"8222":2814,"8224":2801,"8225":2802,"8226":2790,"8229":2735,"8230":2734,"8240":2773,"8242":2774,"8243":2775,"8248":2812,"8254":1150,"8304":16785520,"8308":16785524,"8309":16785525,"8310":16785526,"8311":16785527,"8312":16785528,"8313":16785529,"8320":16785536,"8321":16785537,"8322":16785538,"8323":16785539,"8324":16785540,"8325":16785541,"8326":16785542,"8327":16785543,"8328":16785544,"8329":16785545,"8352":16785568,"8353":16785569,"8354":16785570,"8355":16785571,"8356":16785572,"8357":16785573,"8358":16785574,"8359":16785575,"8360":16785576,"8361":3839,"8362":16785578,"8363":16785579,"8364":8364,"8453":2744,"8470":1712,"8471":2811,"8478":2772,"8482":2761,"8531":2736,"8532":2737,"8533":2738,"8534":2739,"8535":2740,"8536":2741,"8537":2742,"8538":2743,"8539":2755,"8540":2756,"8541":2757,"8542":2758,"8592":2299,"8593":2300,"8594":2301,"8595":2302,"8658":2254,"8660":2253,"8706":2287,"8709":16785925,"8711":2245,"8712":16785928,"8713":16785929,"8715":16785931,"8728":3018,"8730":2262,"8731":16785947,"8732":16785948,"8733":2241,"8734":2242,"8743":2270,"8744":2271,"8745":2268,"8746":2269,"8747":2239,"8748":16785964,"8749":16785965,"8756":2240,"8757":16785973,"8764":2248,"8771":2249,"8773":16785992,"8775":16785991,"8800":2237,"8801":2255,"8802":16786018,"8803":16786019,"8804":2236,"8805":2238,"8834":2266,"8835":2267,"8866":3068,"8867":3036,"8868":3010,"8869":3022,"8968":3027,"8970":3012,"8981":2810,"8992":2212,"8993":2213,"9109":3020,"9115":2219,"9117":2220,"9118":2221,"9120":2222,"9121":2215,"9123":2216,"9124":2217,"9126":2218,"9128":2223,"9132":2224,"9143":2209,"9146":2543,"9147":2544,"9148":2546,"9149":2547,"9225":2530,"9226":2533,"9227":2537,"9228":2531,"9229":2532,"9251":2732,"9252":2536,"9472":2211,"9474":2214,"9484":2210,"9488":2539,"9492":2541,"9496":2538,"9500":2548,"9508":2549,"9516":2551,"9524":2550,"9532":2542,"9618":2529,"9642":2791,"9643":2785,"9644":2779,"9645":2786,"9646":2783,"9647":2767,"9650":2792,"9651":2787,"9654":2781,"9655":2765,"9660":2793,"9661":2788,"9664":2780,"9665":2764,"9670":2528,"9675":2766,"9679":2782,"9702":2784,"9734":2789,"9742":2809,"9747":2762,"9756":2794,"9758":2795,"9792":2808,"9794":2807,"9827":2796,"9829":2798,"9830":2797,"9837":2806,"9839":2805,"10003":2803,"10007":2804,"10013":2777,"10016":2800,"10216":2748,"10217":2750,"10240":16787456,"10241":16787457,"10242":16787458,"10243":16787459,"10244":16787460,"10245":16787461,"10246":16787462,"10247":16787463,"10248":16787464,"10249":16787465,"10250":16787466,"10251":16787467,"10252":16787468,"10253":16787469,"10254":16787470,"10255":16787471,"10256":16787472,"10257":16787473,"10258":16787474,"10259":16787475,"10260":16787476,"10261":16787477,"10262":16787478,"10263":16787479,"10264":16787480,"10265":16787481,"10266":16787482,"10267":16787483,"10268":16787484,"10269":16787485,"10270":16787486,"10271":16787487,"10272":16787488,"10273":16787489,"10274":16787490,"10275":16787491,"10276":16787492,"10277":16787493,"10278":16787494,"10279":16787495,"10280":16787496,"10281":16787497,"10282":16787498,"10283":16787499,"10284":16787500,"10285":16787501,"10286":16787502,"10287":16787503,"10288":16787504,"10289":16787505,"10290":16787506,"10291":16787507,"10292":16787508,"10293":16787509,"10294":16787510,"10295":16787511,"10296":16787512,"10297":16787513,"10298":16787514,"10299":16787515,"10300":16787516,"10301":16787517,"10302":16787518,"10303":16787519,"10304":16787520,"10305":16787521,"10306":16787522,"10307":16787523,"10308":16787524,"10309":16787525,"10310":16787526,"10311":16787527,"10312":16787528,"10313":16787529,"10314":16787530,"10315":16787531,"10316":16787532,"10317":16787533,"10318":16787534,"10319":16787535,"10320":16787536,"10321":16787537,"10322":16787538,"10323":16787539,"10324":16787540,"10325":16787541,"10326":16787542,"10327":16787543,"10328":16787544,"10329":16787545,"10330":16787546,"10331":16787547,"10332":16787548,"10333":16787549,"10334":16787550,"10335":16787551,"10336":16787552,"10337":16787553,"10338":16787554,"10339":16787555,"10340":16787556,"10341":16787557,"10342":16787558,"10343":16787559,"10344":16787560,"10345":16787561,"10346":16787562,"10347":16787563,"10348":16787564,"10349":16787565,"10350":16787566,"10351":16787567,"10352":16787568,"10353":16787569,"10354":16787570,"10355":16787571,"10356":16787572,"10357":16787573,"10358":16787574,"10359":16787575,"10360":16787576,"10361":16787577,"10362":16787578,"10363":16787579,"10364":16787580,"10365":16787581,"10366":16787582,"10367":16787583,"10368":16787584,"10369":16787585,"10370":16787586,"10371":16787587,"10372":16787588,"10373":16787589,"10374":16787590,"10375":16787591,"10376":16787592,"10377":16787593,"10378":16787594,"10379":16787595,"10380":16787596,"10381":16787597,"10382":16787598,"10383":16787599,"10384":16787600,"10385":16787601,"10386":16787602,"10387":16787603,"10388":16787604,"10389":16787605,"10390":16787606,"10391":16787607,"10392":16787608,"10393":16787609,"10394":16787610,"10395":16787611,"10396":16787612,"10397":16787613,"10398":16787614,"10399":16787615,"10400":16787616,"10401":16787617,"10402":16787618,"10403":16787619,"10404":16787620,"10405":16787621,"10406":16787622,"10407":16787623,"10408":16787624,"10409":16787625,"10410":16787626,"10411":16787627,"10412":16787628,"10413":16787629,"10414":16787630,"10415":16787631,"10416":16787632,"10417":16787633,"10418":16787634,"10419":16787635,"10420":16787636,"10421":16787637,"10422":16787638,"10423":16787639,"10424":16787640,"10425":16787641,"10426":16787642,"10427":16787643,"10428":16787644,"10429":16787645,"10430":16787646,"10431":16787647,"10432":16787648,"10433":16787649,"10434":16787650,"10435":16787651,"10436":16787652,"10437":16787653,"10438":16787654,"10439":16787655,"10440":16787656,"10441":16787657,"10442":16787658,"10443":16787659,"10444":16787660,"10445":16787661,"10446":16787662,"10447":16787663,"10448":16787664,"10449":16787665,"10450":16787666,"10451":16787667,"10452":16787668,"10453":16787669,"10454":16787670,"10455":16787671,"10456":16787672,"10457":16787673,"10458":16787674,"10459":16787675,"10460":16787676,"10461":16787677,"10462":16787678,"10463":16787679,"10464":16787680,"10465":16787681,"10466":16787682,"10467":16787683,"10468":16787684,"10469":16787685,"10470":16787686,"10471":16787687,"10472":16787688,"10473":16787689,"10474":16787690,"10475":16787691,"10476":16787692,"10477":16787693,"10478":16787694,"10479":16787695,"10480":16787696,"10481":16787697,"10482":16787698,"10483":16787699,"10484":16787700,"10485":16787701,"10486":16787702,"10487":16787703,"10488":16787704,"10489":16787705,"10490":16787706,"10491":16787707,"10492":16787708,"10493":16787709,"10494":16787710,"10495":16787711,"12289":1188,"12290":1185,"12300":1186,"12301":1187,"12443":1246,"12444":1247,"12449":1191,"12450":1201,"12451":1192,"12452":1202,"12453":1193,"12454":1203,"12455":1194,"12456":1204,"12457":1195,"12458":1205,"12459":1206,"12461":1207,"12463":1208,"12465":1209,"12467":1210,"12469":1211,"12471":1212,"12473":1213,"12475":1214,"12477":1215,"12479":1216,"12481":1217,"12483":1199,"12484":1218,"12486":1219,"12488":1220,"12490":1221,"12491":1222,"12492":1223,"12493":1224,"12494":1225,"12495":1226,"12498":1227,"12501":1228,"12504":1229,"12507":1230,"12510":1231,"12511":1232,"12512":1233,"12513":1234,"12514":1235,"12515":1196,"12516":1236,"12517":1197,"12518":1237,"12519":1198,"12520":1238,"12521":1239,"12522":1240,"12523":1241,"12524":1242,"12525":1243,"12527":1244,"12530":1190,"12531":1245,"12539":1189,"12540":1200}; 9 | 10 | function lookup(k) { return k ? {keysym: k, keyname: keynames ? keynames[k] : k} : undefined; } 11 | return { 12 | fromUnicode : function(u) { return lookup(codepoints[u]); }, 13 | lookup : lookup 14 | }; 15 | })(); 16 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/playback.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Licensed under MPL 2.0 (see LICENSE.txt) 5 | */ 6 | 7 | "use strict"; 8 | /*jslint browser: true, white: false */ 9 | /*global Util, VNC_frame_data, finish */ 10 | 11 | var rfb, mode, test_state, frame_idx, frame_length, 12 | iteration, iterations, istart_time, 13 | 14 | // Pre-declarations for jslint 15 | send_array, next_iteration, queue_next_packet, do_packet, enable_test_mode; 16 | 17 | // Override send_array 18 | send_array = function (arr) { 19 | // Stub out send_array 20 | }; 21 | 22 | enable_test_mode = function () { 23 | rfb._sock._mode = VNC_frame_encoding; 24 | rfb._sock.send = send_array; 25 | rfb._sock.close = function () {}; 26 | rfb._sock.flush = function () {}; 27 | rfb._checkEvents = function () {}; 28 | rfb.connect = function (host, port, password, path) { 29 | this._rfb_host = host; 30 | this._rfb_port = port; 31 | this._rfb_password = (password !== undefined) ? password : ""; 32 | this._rfb_path = (path !== undefined) ? path : ""; 33 | this._sock.init('binary', 'ws'); 34 | this._updateState('ProtocolVersion', "Starting VNC handshake"); 35 | }; 36 | }; 37 | 38 | next_iteration = function () { 39 | rfb = new RFB({'target': $D('VNC_canvas'), 40 | 'onUpdateState': updateState}); 41 | enable_test_mode(); 42 | 43 | if (iteration === 0) { 44 | frame_length = VNC_frame_data.length; 45 | test_state = 'running'; 46 | } 47 | 48 | if (test_state !== 'running') { return; } 49 | 50 | iteration += 1; 51 | if (iteration > iterations) { 52 | finish(); 53 | return; 54 | } 55 | 56 | frame_idx = 0; 57 | istart_time = (new Date()).getTime(); 58 | rfb.connect('test', 0, "bogus"); 59 | 60 | queue_next_packet(); 61 | 62 | }; 63 | 64 | queue_next_packet = function () { 65 | var frame, foffset, toffset, delay; 66 | if (test_state !== 'running') { return; } 67 | 68 | frame = VNC_frame_data[frame_idx]; 69 | while ((frame_idx < frame_length) && (frame.charAt(0) === "}")) { 70 | //Util.Debug("Send frame " + frame_idx); 71 | frame_idx += 1; 72 | frame = VNC_frame_data[frame_idx]; 73 | } 74 | 75 | if (frame === 'EOF') { 76 | Util.Debug("Finished, found EOF"); 77 | next_iteration(); 78 | return; 79 | } 80 | if (frame_idx >= frame_length) { 81 | Util.Debug("Finished, no more frames"); 82 | next_iteration(); 83 | return; 84 | } 85 | 86 | if (mode === 'realtime') { 87 | foffset = frame.slice(1, frame.indexOf('{', 1)); 88 | toffset = (new Date()).getTime() - istart_time; 89 | delay = foffset - toffset; 90 | if (delay < 1) { 91 | delay = 1; 92 | } 93 | 94 | setTimeout(do_packet, delay); 95 | } else { 96 | setTimeout(do_packet, 1); 97 | } 98 | }; 99 | 100 | var bytes_processed = 0; 101 | 102 | do_packet = function () { 103 | //Util.Debug("Processing frame: " + frame_idx); 104 | var frame = VNC_frame_data[frame_idx], 105 | start = frame.indexOf('{', 1) + 1; 106 | bytes_processed += frame.length - start; 107 | if (VNC_frame_encoding === 'binary') { 108 | var u8 = new Uint8Array(frame.length - start); 109 | for (var i = 0; i < frame.length - start; i++) { 110 | u8[i] = frame.charCodeAt(start + i); 111 | } 112 | rfb._sock._recv_message({'data' : u8}); 113 | } else { 114 | rfb._sock._recv_message({'data' : frame.slice(start)}); 115 | } 116 | frame_idx += 1; 117 | 118 | queue_next_packet(); 119 | }; 120 | 121 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/web-socket-js/README.txt: -------------------------------------------------------------------------------- 1 | * How to try 2 | 3 | Assuming you have Web server (e.g. Apache) running at http://example.com/ . 4 | 5 | - Download web_socket.rb from: 6 | http://github.com/gimite/web-socket-ruby/tree/master 7 | - Run sample Web Socket server (echo server) in example.com with: (#1) 8 | $ ruby web-socket-ruby/samples/echo_server.rb example.com 10081 9 | - If your server already provides socket policy file at port 843, modify the file to allow access to port 10081. Otherwise you can skip this step. See below for details. 10 | - Publish the web-socket-js directory with your Web server (e.g. put it in ~/public_html). 11 | - Change ws://localhost:10081 to ws://example.com:10081 in sample.html. 12 | - Open sample.html in your browser. 13 | - After "onopen" is shown, input something, click [Send] and confirm echo back. 14 | 15 | #1: First argument of echo_server.rb means that it accepts Web Socket connection from HTML pages in example.com. 16 | 17 | 18 | * Troubleshooting 19 | 20 | If it doesn't work, try these: 21 | 22 | 1. Try Chrome and Firefox 3.x. 23 | - It doesn't work on Chrome: 24 | -- It's likely an issue of your code or the server. Debug your code as usual e.g. using console.log. 25 | - It works on Chrome but it doesn't work on Firefox: 26 | -- It's likely an issue of web-socket-js specific configuration (e.g. 3 and 4 below). 27 | - It works on both Chrome and Firefox, but it doesn't work on your browser: 28 | -- Check "Supported environment" section below. Your browser may not be supported by web-socket-js. 29 | 30 | 2. Add this line before your code: 31 | WEB_SOCKET_DEBUG = true; 32 | and use Developer Tools (Chrome/Safari) or Firebug (Firefox) to see if console.log outputs any errors. 33 | 34 | 3. Make sure you do NOT open your HTML page as local file e.g. file:///.../sample.html. web-socket-js doesn't work on local file. Open it via Web server e.g. http:///.../sample.html. 35 | 36 | 4. If you are NOT using web-socket-ruby as your WebSocket server, you need to place Flash socket policy file on your server. See "Flash socket policy file" section below for details. 37 | 38 | 5. Check if sample.html bundled with web-socket-js works. 39 | 40 | 6. Make sure the port used for WebSocket (10081 in example above) is not blocked by your server/client's firewall. 41 | 42 | 7. Install debugger version of Flash Player available here to see Flash errors: 43 | http://www.adobe.com/support/flashplayer/downloads.html 44 | 45 | 46 | * Supported environments 47 | 48 | It should work on: 49 | - Google Chrome 4 or later (just uses native implementation) 50 | - Firefox 3.x, Internet Explorer 8 + Flash Player 9 or later 51 | 52 | It may or may not work on other browsers such as Safari, Opera or IE 6. Patch for these browsers are appreciated, but I will not work on fixing issues specific to these browsers by myself. 53 | 54 | 55 | * Flash socket policy file 56 | 57 | This implementation uses Flash's socket, which means that your server must provide Flash socket policy file to declare the server accepts connections from Flash. 58 | 59 | If you use web-socket-ruby available at 60 | http://github.com/gimite/web-socket-ruby/tree/master 61 | , you don't need anything special, because web-socket-ruby handles Flash socket policy file request. But if you already provide socket policy file at port 843, you need to modify the file to allow access to Web Socket port, because it precedes what web-socket-ruby provides. 62 | 63 | If you use other Web Socket server implementation, you need to provide socket policy file yourself. See 64 | http://www.lightsphere.com/dev/articles/flash_socket_policy.html 65 | for details and sample script to run socket policy file server. node.js implementation is available here: 66 | http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/transports/flashsocket.js 67 | 68 | Actually, it's still better to provide socket policy file at port 843 even if you use web-socket-ruby. Flash always try to connect to port 843 first, so providing the file at port 843 makes startup faster. 69 | 70 | 71 | * Cookie considerations 72 | 73 | Cookie is sent if Web Socket host is the same as the origin of JavaScript. Otherwise it is not sent, because I don't know way to send right Cookie (which is Cookie of the host of Web Socket, I heard). 74 | 75 | Note that it's technically possible that client sends arbitrary string as Cookie and any other headers (by modifying this library for example) once you place Flash socket policy file in your server. So don't trust Cookie and other headers if you allow connection from untrusted origin. 76 | 77 | 78 | * Proxy considerations 79 | 80 | The WebSocket spec (http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol) specifies instructions for User Agents to support proxied connections by implementing the HTTP CONNECT method. 81 | 82 | The AS3 Socket class doesn't implement this mechanism, which renders it useless for the scenarios where the user trying to open a socket is behind a proxy. 83 | 84 | The class RFC2817Socket (by Christian Cantrell) effectively lets us implement this, as long as the proxy settings are known and provided by the interface that instantiates the WebSocket. As such, if you want to support proxied conncetions, you'll have to supply this information to the WebSocket constructor when Flash is being used. One way to go about it would be to ask the user for proxy settings information if the initial connection fails. 85 | 86 | 87 | * How to host HTML file and SWF file in different domains 88 | 89 | By default, HTML file and SWF file must be in the same domain. You can follow steps below to allow hosting them in different domain. 90 | 91 | WARNING: If you use the method below, HTML files in ANY domains can send arbitrary TCP data to your WebSocket server, regardless of configuration in Flash socket policy file. Arbitrary TCP data means that they can even fake request headers including Origin and Cookie. 92 | 93 | - Unzip WebSocketMainInsecure.zip to extract WebSocketMainInsecure.swf. 94 | - Put WebSocketMainInsecure.swf on your server, instead of WebSocketMain.swf. 95 | - In JavaScript, set WEB_SOCKET_SWF_LOCATION to URL of your WebSocketMainInsecure.swf. 96 | 97 | 98 | * How to build WebSocketMain.swf 99 | 100 | Install Flex 4 SDK: 101 | http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 102 | 103 | $ cd flash-src 104 | $ ./build.sh 105 | 106 | 107 | * License 108 | 109 | New BSD License. 110 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/web-socket-js/WebSocketMain.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cybercoder/PRVE/83b41e507ca5815560cfa861095cc07838c44a40/modules/servers/prve/novnc/include/web-socket-js/WebSocketMain.swf -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/web-socket-js/swfobject.js: -------------------------------------------------------------------------------- 1 | /* SWFObject v2.2 2 | is released under the MIT License 3 | */ 4 | var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab 2 | // License: New BSD License 3 | // Reference: http://dev.w3.org/html5/websockets/ 4 | // Reference: http://tools.ietf.org/html/rfc6455 5 | 6 | (function() { 7 | 8 | if (window.WEB_SOCKET_FORCE_FLASH) { 9 | // Keeps going. 10 | } else if (window.WebSocket) { 11 | return; 12 | } else if (window.MozWebSocket) { 13 | // Firefox. 14 | window.WebSocket = MozWebSocket; 15 | return; 16 | } 17 | 18 | var logger; 19 | if (window.WEB_SOCKET_LOGGER) { 20 | logger = WEB_SOCKET_LOGGER; 21 | } else if (window.console && window.console.log && window.console.error) { 22 | // In some environment, console is defined but console.log or console.error is missing. 23 | logger = window.console; 24 | } else { 25 | logger = {log: function(){ }, error: function(){ }}; 26 | } 27 | 28 | // swfobject.hasFlashPlayerVersion("10.0.0") doesn't work with Gnash. 29 | if (swfobject.getFlashPlayerVersion().major < 10) { 30 | logger.error("Flash Player >= 10.0.0 is required."); 31 | return; 32 | } 33 | if (location.protocol == "file:") { 34 | logger.error( 35 | "WARNING: web-socket-js doesn't work in file:///... URL " + 36 | "unless you set Flash Security Settings properly. " + 37 | "Open the page via Web server i.e. http://..."); 38 | } 39 | 40 | /** 41 | * Our own implementation of WebSocket class using Flash. 42 | * @param {string} url 43 | * @param {array or string} protocols 44 | * @param {string} proxyHost 45 | * @param {int} proxyPort 46 | * @param {string} headers 47 | */ 48 | window.WebSocket = function(url, protocols, proxyHost, proxyPort, headers) { 49 | var self = this; 50 | self.__id = WebSocket.__nextId++; 51 | WebSocket.__instances[self.__id] = self; 52 | self.readyState = WebSocket.CONNECTING; 53 | self.bufferedAmount = 0; 54 | self.__events = {}; 55 | if (!protocols) { 56 | protocols = []; 57 | } else if (typeof protocols == "string") { 58 | protocols = [protocols]; 59 | } 60 | // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc. 61 | // Otherwise, when onopen fires immediately, onopen is called before it is set. 62 | self.__createTask = setTimeout(function() { 63 | WebSocket.__addTask(function() { 64 | self.__createTask = null; 65 | WebSocket.__flash.create( 66 | self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null); 67 | }); 68 | }, 0); 69 | }; 70 | 71 | /** 72 | * Send data to the web socket. 73 | * @param {string} data The data to send to the socket. 74 | * @return {boolean} True for success, false for failure. 75 | */ 76 | WebSocket.prototype.send = function(data) { 77 | if (this.readyState == WebSocket.CONNECTING) { 78 | throw "INVALID_STATE_ERR: Web Socket connection has not been established"; 79 | } 80 | // We use encodeURIComponent() here, because FABridge doesn't work if 81 | // the argument includes some characters. We don't use escape() here 82 | // because of this: 83 | // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Functions#escape_and_unescape_Functions 84 | // But it looks decodeURIComponent(encodeURIComponent(s)) doesn't 85 | // preserve all Unicode characters either e.g. "\uffff" in Firefox. 86 | // Note by wtritch: Hopefully this will not be necessary using ExternalInterface. Will require 87 | // additional testing. 88 | var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data)); 89 | if (result < 0) { // success 90 | return true; 91 | } else { 92 | this.bufferedAmount += result; 93 | return false; 94 | } 95 | }; 96 | 97 | /** 98 | * Close this web socket gracefully. 99 | */ 100 | WebSocket.prototype.close = function() { 101 | if (this.__createTask) { 102 | clearTimeout(this.__createTask); 103 | this.__createTask = null; 104 | this.readyState = WebSocket.CLOSED; 105 | return; 106 | } 107 | if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) { 108 | return; 109 | } 110 | this.readyState = WebSocket.CLOSING; 111 | WebSocket.__flash.close(this.__id); 112 | }; 113 | 114 | /** 115 | * Implementation of {@link DOM 2 EventTarget Interface} 116 | * 117 | * @param {string} type 118 | * @param {function} listener 119 | * @param {boolean} useCapture 120 | * @return void 121 | */ 122 | WebSocket.prototype.addEventListener = function(type, listener, useCapture) { 123 | if (!(type in this.__events)) { 124 | this.__events[type] = []; 125 | } 126 | this.__events[type].push(listener); 127 | }; 128 | 129 | /** 130 | * Implementation of {@link DOM 2 EventTarget Interface} 131 | * 132 | * @param {string} type 133 | * @param {function} listener 134 | * @param {boolean} useCapture 135 | * @return void 136 | */ 137 | WebSocket.prototype.removeEventListener = function(type, listener, useCapture) { 138 | if (!(type in this.__events)) return; 139 | var events = this.__events[type]; 140 | for (var i = events.length - 1; i >= 0; --i) { 141 | if (events[i] === listener) { 142 | events.splice(i, 1); 143 | break; 144 | } 145 | } 146 | }; 147 | 148 | /** 149 | * Implementation of {@link DOM 2 EventTarget Interface} 150 | * 151 | * @param {Event} event 152 | * @return void 153 | */ 154 | WebSocket.prototype.dispatchEvent = function(event) { 155 | var events = this.__events[event.type] || []; 156 | for (var i = 0; i < events.length; ++i) { 157 | events[i](event); 158 | } 159 | var handler = this["on" + event.type]; 160 | if (handler) handler.apply(this, [event]); 161 | }; 162 | 163 | /** 164 | * Handles an event from Flash. 165 | * @param {Object} flashEvent 166 | */ 167 | WebSocket.prototype.__handleEvent = function(flashEvent) { 168 | 169 | if ("readyState" in flashEvent) { 170 | this.readyState = flashEvent.readyState; 171 | } 172 | if ("protocol" in flashEvent) { 173 | this.protocol = flashEvent.protocol; 174 | } 175 | 176 | var jsEvent; 177 | if (flashEvent.type == "open" || flashEvent.type == "error") { 178 | jsEvent = this.__createSimpleEvent(flashEvent.type); 179 | } else if (flashEvent.type == "close") { 180 | jsEvent = this.__createSimpleEvent("close"); 181 | jsEvent.wasClean = flashEvent.wasClean ? true : false; 182 | jsEvent.code = flashEvent.code; 183 | jsEvent.reason = flashEvent.reason; 184 | } else if (flashEvent.type == "message") { 185 | var data = decodeURIComponent(flashEvent.message); 186 | jsEvent = this.__createMessageEvent("message", data); 187 | } else { 188 | throw "unknown event type: " + flashEvent.type; 189 | } 190 | 191 | this.dispatchEvent(jsEvent); 192 | 193 | }; 194 | 195 | WebSocket.prototype.__createSimpleEvent = function(type) { 196 | if (document.createEvent && window.Event) { 197 | var event = document.createEvent("Event"); 198 | event.initEvent(type, false, false); 199 | return event; 200 | } else { 201 | return {type: type, bubbles: false, cancelable: false}; 202 | } 203 | }; 204 | 205 | WebSocket.prototype.__createMessageEvent = function(type, data) { 206 | if (document.createEvent && window.MessageEvent && !window.opera) { 207 | var event = document.createEvent("MessageEvent"); 208 | event.initMessageEvent("message", false, false, data, null, null, window, null); 209 | return event; 210 | } else { 211 | // IE and Opera, the latter one truncates the data parameter after any 0x00 bytes. 212 | return {type: type, data: data, bubbles: false, cancelable: false}; 213 | } 214 | }; 215 | 216 | /** 217 | * Define the WebSocket readyState enumeration. 218 | */ 219 | WebSocket.CONNECTING = 0; 220 | WebSocket.OPEN = 1; 221 | WebSocket.CLOSING = 2; 222 | WebSocket.CLOSED = 3; 223 | 224 | // Field to check implementation of WebSocket. 225 | WebSocket.__isFlashImplementation = true; 226 | WebSocket.__initialized = false; 227 | WebSocket.__flash = null; 228 | WebSocket.__instances = {}; 229 | WebSocket.__tasks = []; 230 | WebSocket.__nextId = 0; 231 | 232 | /** 233 | * Load a new flash security policy file. 234 | * @param {string} url 235 | */ 236 | WebSocket.loadFlashPolicyFile = function(url){ 237 | WebSocket.__addTask(function() { 238 | WebSocket.__flash.loadManualPolicyFile(url); 239 | }); 240 | }; 241 | 242 | /** 243 | * Loads WebSocketMain.swf and creates WebSocketMain object in Flash. 244 | */ 245 | WebSocket.__initialize = function() { 246 | 247 | if (WebSocket.__initialized) return; 248 | WebSocket.__initialized = true; 249 | 250 | if (WebSocket.__swfLocation) { 251 | // For backword compatibility. 252 | window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation; 253 | } 254 | if (!window.WEB_SOCKET_SWF_LOCATION) { 255 | logger.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf"); 256 | return; 257 | } 258 | if (!window.WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR && 259 | !WEB_SOCKET_SWF_LOCATION.match(/(^|\/)WebSocketMainInsecure\.swf(\?.*)?$/) && 260 | WEB_SOCKET_SWF_LOCATION.match(/^\w+:\/\/([^\/]+)/)) { 261 | var swfHost = RegExp.$1; 262 | if (location.host != swfHost) { 263 | logger.error( 264 | "[WebSocket] You must host HTML and WebSocketMain.swf in the same host " + 265 | "('" + location.host + "' != '" + swfHost + "'). " + 266 | "See also 'How to host HTML file and SWF file in different domains' section " + 267 | "in README.md. If you use WebSocketMainInsecure.swf, you can suppress this message " + 268 | "by WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true;"); 269 | } 270 | } 271 | var container = document.createElement("div"); 272 | container.id = "webSocketContainer"; 273 | // Hides Flash box. We cannot use display: none or visibility: hidden because it prevents 274 | // Flash from loading at least in IE. So we move it out of the screen at (-100, -100). 275 | // But this even doesn't work with Flash Lite (e.g. in Droid Incredible). So with Flash 276 | // Lite, we put it at (0, 0). This shows 1x1 box visible at left-top corner but this is 277 | // the best we can do as far as we know now. 278 | container.style.position = "absolute"; 279 | if (WebSocket.__isFlashLite()) { 280 | container.style.left = "0px"; 281 | container.style.top = "0px"; 282 | } else { 283 | container.style.left = "-100px"; 284 | container.style.top = "-100px"; 285 | } 286 | var holder = document.createElement("div"); 287 | holder.id = "webSocketFlash"; 288 | container.appendChild(holder); 289 | document.body.appendChild(container); 290 | // See this article for hasPriority: 291 | // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html 292 | swfobject.embedSWF( 293 | WEB_SOCKET_SWF_LOCATION, 294 | "webSocketFlash", 295 | "1" /* width */, 296 | "1" /* height */, 297 | "10.0.0" /* SWF version */, 298 | null, 299 | null, 300 | {hasPriority: true, swliveconnect : true, allowScriptAccess: "always"}, 301 | null, 302 | function(e) { 303 | if (!e.success) { 304 | logger.error("[WebSocket] swfobject.embedSWF failed"); 305 | } 306 | } 307 | ); 308 | 309 | }; 310 | 311 | /** 312 | * Called by Flash to notify JS that it's fully loaded and ready 313 | * for communication. 314 | */ 315 | WebSocket.__onFlashInitialized = function() { 316 | // We need to set a timeout here to avoid round-trip calls 317 | // to flash during the initialization process. 318 | setTimeout(function() { 319 | WebSocket.__flash = document.getElementById("webSocketFlash"); 320 | WebSocket.__flash.setCallerUrl(location.href); 321 | WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG); 322 | for (var i = 0; i < WebSocket.__tasks.length; ++i) { 323 | WebSocket.__tasks[i](); 324 | } 325 | WebSocket.__tasks = []; 326 | }, 0); 327 | }; 328 | 329 | /** 330 | * Called by Flash to notify WebSockets events are fired. 331 | */ 332 | WebSocket.__onFlashEvent = function() { 333 | setTimeout(function() { 334 | try { 335 | // Gets events using receiveEvents() instead of getting it from event object 336 | // of Flash event. This is to make sure to keep message order. 337 | // It seems sometimes Flash events don't arrive in the same order as they are sent. 338 | var events = WebSocket.__flash.receiveEvents(); 339 | for (var i = 0; i < events.length; ++i) { 340 | WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]); 341 | } 342 | } catch (e) { 343 | logger.error(e); 344 | } 345 | }, 0); 346 | return true; 347 | }; 348 | 349 | // Called by Flash. 350 | WebSocket.__log = function(message) { 351 | logger.log(decodeURIComponent(message)); 352 | }; 353 | 354 | // Called by Flash. 355 | WebSocket.__error = function(message) { 356 | logger.error(decodeURIComponent(message)); 357 | }; 358 | 359 | WebSocket.__addTask = function(task) { 360 | if (WebSocket.__flash) { 361 | task(); 362 | } else { 363 | WebSocket.__tasks.push(task); 364 | } 365 | }; 366 | 367 | /** 368 | * Test if the browser is running flash lite. 369 | * @return {boolean} True if flash lite is running, false otherwise. 370 | */ 371 | WebSocket.__isFlashLite = function() { 372 | if (!window.navigator || !window.navigator.mimeTypes) { 373 | return false; 374 | } 375 | var mimeType = window.navigator.mimeTypes["application/x-shockwave-flash"]; 376 | if (!mimeType || !mimeType.enabledPlugin || !mimeType.enabledPlugin.filename) { 377 | return false; 378 | } 379 | return mimeType.enabledPlugin.filename.match(/flashlite/i) ? true : false; 380 | }; 381 | 382 | if (!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION) { 383 | // NOTE: 384 | // This fires immediately if web_socket.js is dynamically loaded after 385 | // the document is loaded. 386 | swfobject.addDomLoadEvent(function() { 387 | WebSocket.__initialize(); 388 | }); 389 | } 390 | 391 | })(); 392 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/websock.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Websock: high-performance binary WebSockets 3 | * Copyright (C) 2012 Joel Martin 4 | * Licensed under MPL 2.0 (see LICENSE.txt) 5 | * 6 | * Websock is similar to the standard WebSocket object but Websock 7 | * enables communication with raw TCP sockets (i.e. the binary stream) 8 | * via websockify. This is accomplished by base64 encoding the data 9 | * stream between Websock and websockify. 10 | * 11 | * Websock has built-in receive queue buffering; the message event 12 | * does not contain actual data but is simply a notification that 13 | * there is new data available. Several rQ* methods are available to 14 | * read binary data off of the receive queue. 15 | */ 16 | 17 | /*jslint browser: true, bitwise: true */ 18 | /*global Util*/ 19 | 20 | 21 | // Load Flash WebSocket emulator if needed 22 | 23 | // To force WebSocket emulator even when native WebSocket available 24 | //window.WEB_SOCKET_FORCE_FLASH = true; 25 | // To enable WebSocket emulator debug: 26 | //window.WEB_SOCKET_DEBUG=1; 27 | 28 | if (window.WebSocket && !window.WEB_SOCKET_FORCE_FLASH) { 29 | Websock_native = true; 30 | } else if (window.MozWebSocket && !window.WEB_SOCKET_FORCE_FLASH) { 31 | Websock_native = true; 32 | window.WebSocket = window.MozWebSocket; 33 | } else { 34 | /* no builtin WebSocket so load web_socket.js */ 35 | 36 | Websock_native = false; 37 | } 38 | 39 | function Websock() { 40 | "use strict"; 41 | 42 | this._websocket = null; // WebSocket object 43 | 44 | this._rQi = 0; // Receive queue index 45 | this._rQlen = 0; // Next write position in the receive queue 46 | this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB) 47 | this._rQmax = this._rQbufferSize / 8; 48 | // called in init: this._rQ = new Uint8Array(this._rQbufferSize); 49 | this._rQ = null; // Receive queue 50 | 51 | this._sQbufferSize = 1024 * 10; // 10 KiB 52 | // called in init: this._sQ = new Uint8Array(this._sQbufferSize); 53 | this._sQlen = 0; 54 | this._sQ = null; // Send queue 55 | 56 | this._mode = 'binary'; // Current WebSocket mode: 'binary', 'base64' 57 | this.maxBufferedAmount = 200; 58 | 59 | this._eventHandlers = { 60 | 'message': function () {}, 61 | 'open': function () {}, 62 | 'close': function () {}, 63 | 'error': function () {} 64 | }; 65 | } 66 | 67 | (function () { 68 | "use strict"; 69 | // this has performance issues in some versions Chromium, and 70 | // doesn't gain a tremendous amount of performance increase in Firefox 71 | // at the moment. It may be valuable to turn it on in the future. 72 | var ENABLE_COPYWITHIN = false; 73 | 74 | var MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB 75 | 76 | var typedArrayToString = (function () { 77 | // This is only for PhantomJS, which doesn't like apply-ing 78 | // with Typed Arrays 79 | try { 80 | var arr = new Uint8Array([1, 2, 3]); 81 | String.fromCharCode.apply(null, arr); 82 | return function (a) { return String.fromCharCode.apply(null, a); }; 83 | } catch (ex) { 84 | return function (a) { 85 | return String.fromCharCode.apply( 86 | null, Array.prototype.slice.call(a)); 87 | }; 88 | } 89 | })(); 90 | 91 | Websock.prototype = { 92 | // Getters and Setters 93 | get_sQ: function () { 94 | return this._sQ; 95 | }, 96 | 97 | get_rQ: function () { 98 | return this._rQ; 99 | }, 100 | 101 | get_rQi: function () { 102 | return this._rQi; 103 | }, 104 | 105 | set_rQi: function (val) { 106 | this._rQi = val; 107 | }, 108 | 109 | // Receive Queue 110 | rQlen: function () { 111 | return this._rQlen - this._rQi; 112 | }, 113 | 114 | rQpeek8: function () { 115 | return this._rQ[this._rQi]; 116 | }, 117 | 118 | rQshift8: function () { 119 | return this._rQ[this._rQi++]; 120 | }, 121 | 122 | rQskip8: function () { 123 | this._rQi++; 124 | }, 125 | 126 | rQskipBytes: function (num) { 127 | this._rQi += num; 128 | }, 129 | 130 | // TODO(directxman12): test performance with these vs a DataView 131 | rQshift16: function () { 132 | return (this._rQ[this._rQi++] << 8) + 133 | this._rQ[this._rQi++]; 134 | }, 135 | 136 | rQshift32: function () { 137 | return (this._rQ[this._rQi++] << 24) + 138 | (this._rQ[this._rQi++] << 16) + 139 | (this._rQ[this._rQi++] << 8) + 140 | this._rQ[this._rQi++]; 141 | }, 142 | 143 | rQshiftStr: function (len) { 144 | if (typeof(len) === 'undefined') { len = this.rQlen(); } 145 | var arr = new Uint8Array(this._rQ.buffer, this._rQi, len); 146 | this._rQi += len; 147 | return typedArrayToString(arr); 148 | }, 149 | 150 | rQshiftBytes: function (len) { 151 | if (typeof(len) === 'undefined') { len = this.rQlen(); } 152 | this._rQi += len; 153 | return new Uint8Array(this._rQ.buffer, this._rQi - len, len); 154 | }, 155 | 156 | rQshiftTo: function (target, len) { 157 | if (len === undefined) { len = this.rQlen(); } 158 | // TODO: make this just use set with views when using a ArrayBuffer to store the rQ 159 | target.set(new Uint8Array(this._rQ.buffer, this._rQi, len)); 160 | this._rQi += len; 161 | }, 162 | 163 | rQwhole: function () { 164 | return new Uint8Array(this._rQ.buffer, 0, this._rQlen); 165 | }, 166 | 167 | rQslice: function (start, end) { 168 | if (end) { 169 | return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start); 170 | } else { 171 | return new Uint8Array(this._rQ.buffer, this._rQi + start, this._rQlen - this._rQi - start); 172 | } 173 | }, 174 | 175 | // Check to see if we must wait for 'num' bytes (default to FBU.bytes) 176 | // to be available in the receive queue. Return true if we need to 177 | // wait (and possibly print a debug message), otherwise false. 178 | rQwait: function (msg, num, goback) { 179 | var rQlen = this._rQlen - this._rQi; // Skip rQlen() function call 180 | if (rQlen < num) { 181 | if (goback) { 182 | if (this._rQi < goback) { 183 | throw new Error("rQwait cannot backup " + goback + " bytes"); 184 | } 185 | this._rQi -= goback; 186 | } 187 | return true; // true means need more data 188 | } 189 | return false; 190 | }, 191 | 192 | // Send Queue 193 | 194 | flush: function () { 195 | if (this._websocket.bufferedAmount !== 0) { 196 | Util.Debug("bufferedAmount: " + this._websocket.bufferedAmount); 197 | } 198 | 199 | if (this._websocket.bufferedAmount < this.maxBufferedAmount) { 200 | if (this._sQlen > 0) { 201 | this._websocket.send(this._encode_message()); 202 | this._sQlen = 0; 203 | } 204 | 205 | return true; 206 | } else { 207 | Util.Info("Delaying send, bufferedAmount: " + 208 | this._websocket.bufferedAmount); 209 | return false; 210 | } 211 | }, 212 | 213 | send: function (arr) { 214 | this._sQ.set(arr, this._sQlen); 215 | this._sQlen += arr.length; 216 | return this.flush(); 217 | }, 218 | 219 | send_string: function (str) { 220 | this.send(str.split('').map(function (chr) { 221 | return chr.charCodeAt(0); 222 | })); 223 | }, 224 | 225 | // Event Handlers 226 | off: function (evt) { 227 | this._eventHandlers[evt] = function () {}; 228 | }, 229 | 230 | on: function (evt, handler) { 231 | this._eventHandlers[evt] = handler; 232 | }, 233 | 234 | _allocate_buffers: function () { 235 | this._rQ = new Uint8Array(this._rQbufferSize); 236 | this._sQ = new Uint8Array(this._sQbufferSize); 237 | }, 238 | 239 | init: function (protocols, ws_schema) { 240 | this._allocate_buffers(); 241 | this._rQi = 0; 242 | this._websocket = null; 243 | 244 | // Check for full typed array support 245 | var bt = false; 246 | if (('Uint8Array' in window) && 247 | ('set' in Uint8Array.prototype)) { 248 | bt = true; 249 | } 250 | 251 | // Check for full binary type support in WebSockets 252 | // Inspired by: 253 | // https://github.com/Modernizr/Modernizr/issues/370 254 | // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/websockets/binary.js 255 | var wsbt = false; 256 | try { 257 | if (bt && ('binaryType' in WebSocket.prototype || 258 | !!(new WebSocket(ws_schema + '://.').binaryType))) { 259 | Util.Info("Detected binaryType support in WebSockets"); 260 | wsbt = true; 261 | } 262 | } catch (exc) { 263 | // Just ignore failed test localhost connection 264 | } 265 | 266 | // Default protocols if not specified 267 | if (typeof(protocols) === "undefined") { 268 | protocols = 'binary'; 269 | } 270 | 271 | if (Array.isArray(protocols) && protocols.indexOf('binary') > -1) { 272 | protocols = 'binary'; 273 | } 274 | 275 | if (!wsbt) { 276 | throw new Error("noVNC no longer supports base64 WebSockets. " + 277 | "Please use a browser which supports binary WebSockets."); 278 | } 279 | 280 | if (protocols != 'binary') { 281 | throw new Error("noVNC no longer supports base64 WebSockets. Please " + 282 | "use the binary subprotocol instead."); 283 | } 284 | 285 | return protocols; 286 | }, 287 | 288 | open: function (uri, protocols) { 289 | var ws_schema = uri.match(/^([a-z]+):\/\//)[1]; 290 | protocols = this.init(protocols, ws_schema); 291 | 292 | this._websocket = new WebSocket(uri, protocols); 293 | 294 | if (protocols.indexOf('binary') >= 0) { 295 | this._websocket.binaryType = 'arraybuffer'; 296 | } 297 | 298 | this._websocket.onmessage = this._recv_message.bind(this); 299 | this._websocket.onopen = (function () { 300 | Util.Debug('>> WebSock.onopen'); 301 | if (this._websocket.protocol) { 302 | this._mode = this._websocket.protocol; 303 | Util.Info("Server choose sub-protocol: " + this._websocket.protocol); 304 | } else { 305 | this._mode = 'binary'; 306 | Util.Error('Server select no sub-protocol!: ' + this._websocket.protocol); 307 | } 308 | 309 | if (this._mode != 'binary') { 310 | throw new Error("noVNC no longer supports base64 WebSockets. Please " + 311 | "use the binary subprotocol instead."); 312 | 313 | } 314 | 315 | this._eventHandlers.open(); 316 | Util.Debug("<< WebSock.onopen"); 317 | }).bind(this); 318 | this._websocket.onclose = (function (e) { 319 | Util.Debug(">> WebSock.onclose"); 320 | this._eventHandlers.close(e); 321 | Util.Debug("<< WebSock.onclose"); 322 | }).bind(this); 323 | this._websocket.onerror = (function (e) { 324 | Util.Debug(">> WebSock.onerror: " + e); 325 | this._eventHandlers.error(e); 326 | Util.Debug("<< WebSock.onerror: " + e); 327 | }).bind(this); 328 | }, 329 | 330 | close: function () { 331 | if (this._websocket) { 332 | if ((this._websocket.readyState === WebSocket.OPEN) || 333 | (this._websocket.readyState === WebSocket.CONNECTING)) { 334 | Util.Info("Closing WebSocket connection"); 335 | this._websocket.close(); 336 | } 337 | 338 | this._websocket.onmessage = function (e) { return; }; 339 | } 340 | }, 341 | 342 | // private methods 343 | _encode_message: function () { 344 | // Put in a binary arraybuffer 345 | // according to the spec, you can send ArrayBufferViews with the send method 346 | return new Uint8Array(this._sQ.buffer, 0, this._sQlen); 347 | }, 348 | 349 | _expand_compact_rQ: function (min_fit) { 350 | var resizeNeeded = min_fit || this._rQlen - this._rQi > this._rQbufferSize / 2; 351 | if (resizeNeeded) { 352 | if (!min_fit) { 353 | // just double the size if we need to do compaction 354 | this._rQbufferSize *= 2; 355 | } else { 356 | // otherwise, make sure we satisy rQlen - rQi + min_fit < rQbufferSize / 8 357 | this._rQbufferSize = (this._rQlen - this._rQi + min_fit) * 8; 358 | } 359 | } 360 | 361 | // we don't want to grow unboundedly 362 | if (this._rQbufferSize > MAX_RQ_GROW_SIZE) { 363 | this._rQbufferSize = MAX_RQ_GROW_SIZE; 364 | if (this._rQbufferSize - this._rQlen - this._rQi < min_fit) { 365 | throw new Exception("Receive Queue buffer exceeded " + MAX_RQ_GROW_SIZE + " bytes, and the new message could not fit"); 366 | } 367 | } 368 | 369 | if (resizeNeeded) { 370 | var old_rQbuffer = this._rQ.buffer; 371 | this._rQmax = this._rQbufferSize / 8; 372 | this._rQ = new Uint8Array(this._rQbufferSize); 373 | this._rQ.set(new Uint8Array(old_rQbuffer, this._rQi)); 374 | } else { 375 | if (ENABLE_COPYWITHIN) { 376 | this._rQ.copyWithin(0, this._rQi); 377 | } else { 378 | this._rQ.set(new Uint8Array(this._rQ.buffer, this._rQi)); 379 | } 380 | } 381 | 382 | this._rQlen = this._rQlen - this._rQi; 383 | this._rQi = 0; 384 | }, 385 | 386 | _decode_message: function (data) { 387 | // push arraybuffer values onto the end 388 | var u8 = new Uint8Array(data); 389 | if (u8.length > this._rQbufferSize - this._rQlen) { 390 | this._expand_compact_rQ(u8.length); 391 | } 392 | this._rQ.set(u8, this._rQlen); 393 | this._rQlen += u8.length; 394 | }, 395 | 396 | _recv_message: function (e) { 397 | try { 398 | this._decode_message(e.data); 399 | if (this.rQlen() > 0) { 400 | this._eventHandlers.message(); 401 | // Compact the receive queue 402 | if (this._rQlen == this._rQi) { 403 | this._rQlen = 0; 404 | this._rQi = 0; 405 | } else if (this._rQlen > this._rQmax) { 406 | this._expand_compact_rQ(); 407 | } 408 | } else { 409 | Util.Debug("Ignoring empty message"); 410 | } 411 | } catch (exc) { 412 | var exception_str = ""; 413 | if (exc.name) { 414 | exception_str += "\n name: " + exc.name + "\n"; 415 | exception_str += " message: " + exc.message + "\n"; 416 | } 417 | 418 | if (typeof exc.description !== 'undefined') { 419 | exception_str += " description: " + exc.description + "\n"; 420 | } 421 | 422 | if (typeof exc.stack !== 'undefined') { 423 | exception_str += exc.stack; 424 | } 425 | 426 | if (exception_str.length > 0) { 427 | Util.Error("recv_message, caught exception: " + exception_str); 428 | } else { 429 | Util.Error("recv_message, caught exception: " + exc); 430 | } 431 | 432 | if (typeof exc.name !== 'undefined') { 433 | this._eventHandlers.error(exc.name + ": " + exc.message); 434 | } else { 435 | this._eventHandlers.error(exc); 436 | } 437 | } 438 | } 439 | }; 440 | })(); 441 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/include/webutil.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2013 NTT corp. 5 | * Licensed under MPL 2.0 (see LICENSE.txt) 6 | * 7 | * See README.md for usage and integration instructions. 8 | */ 9 | 10 | /*jslint bitwise: false, white: false, browser: true, devel: true */ 11 | /*global Util, window, document */ 12 | 13 | // Globals defined here 14 | var WebUtil = {}, $D; 15 | 16 | /* 17 | * Simple DOM selector by ID 18 | */ 19 | if (!window.$D) { 20 | window.$D = function (id) { 21 | if (document.getElementById) { 22 | return document.getElementById(id); 23 | } else if (document.all) { 24 | return document.all[id]; 25 | } else if (document.layers) { 26 | return document.layers[id]; 27 | } 28 | return undefined; 29 | }; 30 | } 31 | 32 | 33 | /* 34 | * ------------------------------------------------------ 35 | * Namespaced in WebUtil 36 | * ------------------------------------------------------ 37 | */ 38 | 39 | // init log level reading the logging HTTP param 40 | WebUtil.init_logging = function (level) { 41 | "use strict"; 42 | if (typeof level !== "undefined") { 43 | Util._log_level = level; 44 | } else { 45 | var param = document.location.href.match(/logging=([A-Za-z0-9\._\-]*)/); 46 | Util._log_level = (param || ['', Util._log_level])[1]; 47 | } 48 | Util.init_logging(); 49 | }; 50 | 51 | 52 | WebUtil.dirObj = function (obj, depth, parent) { 53 | "use strict"; 54 | if (! depth) { depth = 2; } 55 | if (! parent) { parent = ""; } 56 | 57 | // Print the properties of the passed-in object 58 | var msg = ""; 59 | for (var i in obj) { 60 | if ((depth > 1) && (typeof obj[i] === "object")) { 61 | // Recurse attributes that are objects 62 | msg += WebUtil.dirObj(obj[i], depth - 1, parent + "." + i); 63 | } else { 64 | //val = new String(obj[i]).replace("\n", " "); 65 | var val = ""; 66 | if (typeof(obj[i]) === "undefined") { 67 | val = "undefined"; 68 | } else { 69 | val = obj[i].toString().replace("\n", " "); 70 | } 71 | if (val.length > 30) { 72 | val = val.substr(0, 30) + "..."; 73 | } 74 | msg += parent + "." + i + ": " + val + "\n"; 75 | } 76 | } 77 | return msg; 78 | }; 79 | 80 | // Read a query string variable 81 | WebUtil.getQueryVar = function (name, defVal) { 82 | "use strict"; 83 | var re = new RegExp('.*[?&]' + name + '=([^&#]*)'), 84 | match = document.location.href.match(re); 85 | if (typeof defVal === 'undefined') { defVal = null; } 86 | if (match) { 87 | return decodeURIComponent(match[1]); 88 | } else { 89 | return defVal; 90 | } 91 | }; 92 | 93 | // Read a hash fragment variable 94 | WebUtil.getHashVar = function (name, defVal) { 95 | "use strict"; 96 | var re = new RegExp('.*[&#]' + name + '=([^&]*)'), 97 | match = document.location.hash.match(re); 98 | if (typeof defVal === 'undefined') { defVal = null; } 99 | if (match) { 100 | return decodeURIComponent(match[1]); 101 | } else { 102 | return defVal; 103 | } 104 | }; 105 | 106 | // Read a variable from the fragment or the query string 107 | // Fragment takes precedence 108 | WebUtil.getConfigVar = function (name, defVal) { 109 | "use strict"; 110 | var val = WebUtil.getHashVar(name); 111 | if (val === null) { 112 | val = WebUtil.getQueryVar(name, defVal); 113 | } 114 | return val; 115 | }; 116 | 117 | /* 118 | * Cookie handling. Dervied from: http://www.quirksmode.org/js/cookies.html 119 | */ 120 | 121 | // No days means only for this browser session 122 | WebUtil.createCookie = function (name, value, days) { 123 | "use strict"; 124 | var date, expires; 125 | if (days) { 126 | date = new Date(); 127 | date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 128 | expires = "; expires=" + date.toGMTString(); 129 | } else { 130 | expires = ""; 131 | } 132 | 133 | var secure; 134 | if (document.location.protocol === "https:") { 135 | secure = "; secure"; 136 | } else { 137 | secure = ""; 138 | } 139 | document.cookie = name + "=" + value + expires + "; path=/" + secure; 140 | }; 141 | 142 | WebUtil.readCookie = function (name, defaultValue) { 143 | "use strict"; 144 | var nameEQ = name + "=", 145 | ca = document.cookie.split(';'); 146 | 147 | for (var i = 0; i < ca.length; i += 1) { 148 | var c = ca[i]; 149 | while (c.charAt(0) === ' ') { c = c.substring(1, c.length); } 150 | if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length, c.length); } 151 | } 152 | return (typeof defaultValue !== 'undefined') ? defaultValue : null; 153 | }; 154 | 155 | WebUtil.eraseCookie = function (name) { 156 | "use strict"; 157 | WebUtil.createCookie(name, "", -1); 158 | }; 159 | 160 | /* 161 | * Setting handling. 162 | */ 163 | 164 | WebUtil.initSettings = function (callback /*, ...callbackArgs */) { 165 | "use strict"; 166 | var callbackArgs = Array.prototype.slice.call(arguments, 1); 167 | if (window.chrome && window.chrome.storage) { 168 | window.chrome.storage.sync.get(function (cfg) { 169 | WebUtil.settings = cfg; 170 | console.log(WebUtil.settings); 171 | if (callback) { 172 | callback.apply(this, callbackArgs); 173 | } 174 | }); 175 | } else { 176 | // No-op 177 | if (callback) { 178 | callback.apply(this, callbackArgs); 179 | } 180 | } 181 | }; 182 | 183 | // No days means only for this browser session 184 | WebUtil.writeSetting = function (name, value) { 185 | "use strict"; 186 | if (window.chrome && window.chrome.storage) { 187 | //console.log("writeSetting:", name, value); 188 | if (WebUtil.settings[name] !== value) { 189 | WebUtil.settings[name] = value; 190 | window.chrome.storage.sync.set(WebUtil.settings); 191 | } 192 | } else { 193 | localStorage.setItem(name, value); 194 | } 195 | }; 196 | 197 | WebUtil.readSetting = function (name, defaultValue) { 198 | "use strict"; 199 | var value; 200 | if (window.chrome && window.chrome.storage) { 201 | value = WebUtil.settings[name]; 202 | } else { 203 | value = localStorage.getItem(name); 204 | } 205 | if (typeof value === "undefined") { 206 | value = null; 207 | } 208 | if (value === null && typeof defaultValue !== undefined) { 209 | return defaultValue; 210 | } else { 211 | return value; 212 | } 213 | }; 214 | 215 | WebUtil.eraseSetting = function (name) { 216 | "use strict"; 217 | if (window.chrome && window.chrome.storage) { 218 | window.chrome.storage.sync.remove(name); 219 | delete WebUtil.settings[name]; 220 | } else { 221 | localStorage.removeItem(name); 222 | } 223 | }; 224 | 225 | /* 226 | * Alternate stylesheet selection 227 | */ 228 | WebUtil.getStylesheets = function () { 229 | "use strict"; 230 | var links = document.getElementsByTagName("link"); 231 | var sheets = []; 232 | 233 | for (var i = 0; i < links.length; i += 1) { 234 | if (links[i].title && 235 | links[i].rel.toUpperCase().indexOf("STYLESHEET") > -1) { 236 | sheets.push(links[i]); 237 | } 238 | } 239 | return sheets; 240 | }; 241 | 242 | // No sheet means try and use value from cookie, null sheet used to 243 | // clear all alternates. 244 | WebUtil.selectStylesheet = function (sheet) { 245 | "use strict"; 246 | if (typeof sheet === 'undefined') { 247 | sheet = 'default'; 248 | } 249 | 250 | var sheets = WebUtil.getStylesheets(); 251 | for (var i = 0; i < sheets.length; i += 1) { 252 | var link = sheets[i]; 253 | if (link.title === sheet) { 254 | Util.Debug("Using stylesheet " + sheet); 255 | link.disabled = false; 256 | } else { 257 | //Util.Debug("Skipping stylesheet " + link.title); 258 | link.disabled = true; 259 | } 260 | } 261 | return sheet; 262 | }; 263 | 264 | WebUtil.injectParamIfMissing = function (path, param, value) { 265 | // force pretend that we're dealing with a relative path 266 | // (assume that we wanted an extra if we pass one in) 267 | path = "/" + path; 268 | 269 | var elem = document.createElement('a'); 270 | elem.href = path; 271 | 272 | var param_eq = encodeURIComponent(param) + "="; 273 | var query; 274 | if (elem.search) { 275 | query = elem.search.slice(1).split('&'); 276 | } else { 277 | query = []; 278 | } 279 | 280 | if (!query.some(function (v) { return v.startsWith(param_eq); })) { 281 | query.push(param_eq + encodeURIComponent(value)); 282 | elem.search = "?" + query.join("&"); 283 | } 284 | 285 | return elem.pathname.slice(1) + elem.search + elem.hash; 286 | }; 287 | -------------------------------------------------------------------------------- /modules/servers/prve/novnc/novnc_pve.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | noVNC 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 47 | 48 | 49 |
50 |
51 | 52 | 55 | 67 |
53 | Loading 54 |
56 | 58 | 59 | 61 | 63 | 65 | 66 |
68 |
69 | 70 | Canvas not supported. 71 | 72 |
73 | 74 | 244 | 245 | 246 | 247 | -------------------------------------------------------------------------------- /modules/servers/prve/tigervnc.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Serial Console 4 | 5 | 6 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | '; 19 | ?> 20 | 21 | 22 | --------------------------------------------------------------------------------