Set websocket URL protocol based on document.location.protocol
This commit is contained in:
		
							parent
							
								
									8910eba396
								
							
						
					
					
						commit
						daac439e9a
					
				@ -6,10 +6,8 @@ import { Observable } from 'rxjs';
 | 
				
			|||||||
import { MemPoolService } from './mem-pool.service';
 | 
					import { MemPoolService } from './mem-pool.service';
 | 
				
			||||||
import { tap, retryWhen, delay } from 'rxjs/operators';
 | 
					import { tap, retryWhen, delay } from 'rxjs/operators';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let WEB_SOCKET_PROTOCOL = 'wss://';
 | 
					const WEB_SOCKET_PROTOCOL = (document.location.protocol == 'https:') ? 'wss:' : 'ws:';
 | 
				
			||||||
if (document.location.hostname.indexOf('onion') != -1)
 | 
					const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + '/ws';
 | 
				
			||||||
       WEB_SOCKET_PROTOCOL = 'ws://'
 | 
					 | 
				
			||||||
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + document.location.hostname + '/ws';
 | 
					 | 
				
			||||||
const API_BASE_URL = '/api/v1';
 | 
					const API_BASE_URL = '/api/v1';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user