mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 19:49:01 +01:00 
			
		
		
		
	using WSS protocol when on HTTPS instead of WS
This commit is contained in:
		
							parent
							
								
									15faefe8a3
								
							
						
					
					
						commit
						28bc443914
					
				| @ -39,9 +39,11 @@ const messaging = (function() { | ||||
|     } | ||||
| 
 | ||||
|     function connectWebSocket() { | ||||
|         const protocol = document.location.protocol === 'https:' ? 'wss' : 'ws'; | ||||
| 
 | ||||
|         // use wss for secure messaging
 | ||||
|         ws = new WebSocket("ws://" + location.host); | ||||
|         ws.onopen = function (event) {}; | ||||
|         ws = new WebSocket(protocol + "://" + location.host); | ||||
|         ws.onopen = event => console.log("Connected to server with WebSocket"); | ||||
|         ws.onmessage = messageHandler; | ||||
|         ws.onclose = function(){ | ||||
|             // Try to reconnect in 5 seconds
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner