mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
Fix websocket URL to work with both clearnet and onion
This commit is contained in:
parent
b91374709d
commit
8910eba396
1 changed files with 4 additions and 1 deletions
|
|
@ -6,7 +6,10 @@ import { Observable } from 'rxjs';
|
|||
import { MemPoolService } from './mem-pool.service';
|
||||
import { tap, retryWhen, delay } from 'rxjs/operators';
|
||||
|
||||
const WEB_SOCKET_URL = 'ws://' + document.location.hostname + '/ws';
|
||||
let WEB_SOCKET_PROTOCOL = 'wss://';
|
||||
if (document.location.hostname.indexOf('onion') != -1)
|
||||
WEB_SOCKET_PROTOCOL = 'ws://'
|
||||
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + document.location.hostname + '/ws';
|
||||
const API_BASE_URL = '/api/v1';
|
||||
|
||||
@Injectable({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue