= 'http:') {
				document.getElementById('target').value = 'ws://' + window.location.host + document.getElementById('target').value;
			} else {
				document.getElementById('target').value = 'wss://' + window.location.host + document.getElementById('target').value;
			}
		}

		function disconnect() {
			if (ws != null) {
				ws.close();
				ws = null;
			}
			setConnected(false);
		}

		function reverse() {
			if (ws != null) {
				var message = document.getElementById('message').value;
				log('Sent: ' + m