Add support for websockets over HTTP
in addition to HTTPS
This commit is contained in:
		
							parent
							
								
									c389ebabd0
								
							
						
					
					
						commit
						0a0b471a03
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -200,8 +200,8 @@
 | 
			
		|||
        ThisPage.mounted = function() {
 | 
			
		||||
 | 
			
		||||
            ## TODO: should be a cleaner way to get this url?
 | 
			
		||||
            let url = '${request.route_url('ws.datasync.status')}'
 | 
			
		||||
            url = url.replace(/^https?:/, 'wss:')
 | 
			
		||||
            let url = '${url('ws.datasync.status')}'
 | 
			
		||||
            url = url.replace(/^http(s?):/, 'ws$1:')
 | 
			
		||||
 | 
			
		||||
            this.ws = new WebSocket(url)
 | 
			
		||||
            let that = this
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -211,8 +211,8 @@
 | 
			
		|||
            ThisPage.methods.establishWebsocket = function() {
 | 
			
		||||
 | 
			
		||||
                ## TODO: should be a cleaner way to get this url?
 | 
			
		||||
                url = '${request.route_url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
 | 
			
		||||
                url = url.replace(/^https?:/, 'wss:')
 | 
			
		||||
                let url = '${url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
 | 
			
		||||
                url = url.replace(/^http(s?):/, 'ws$1:')
 | 
			
		||||
 | 
			
		||||
                this.ws = new WebSocket(url)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue