mirror of
https://github.com/mempool/mempool.git
synced 2025-03-15 12:20:28 +01:00
Proxy websocket when running local environment.
This commit is contained in:
parent
e95b90b857
commit
53269a805b
3 changed files with 9 additions and 4 deletions
|
@ -50,8 +50,8 @@ class MempoolSpace {
|
||||||
statistics.startStatistics();
|
statistics.startStatistics();
|
||||||
fiatConversion.startService();
|
fiatConversion.startService();
|
||||||
|
|
||||||
let opts = {
|
const opts = {
|
||||||
host: "127.0.0.1",
|
host: '127.0.0.1',
|
||||||
port: 8999
|
port: 8999
|
||||||
};
|
};
|
||||||
this.server.listen(opts, () => {
|
this.server.listen(opts, () => {
|
||||||
|
|
|
@ -2,5 +2,10 @@
|
||||||
"/api": {
|
"/api": {
|
||||||
"target": "http://localhost:8999/",
|
"target": "http://localhost:8999/",
|
||||||
"secure": false
|
"secure": false
|
||||||
|
},
|
||||||
|
"/ws": {
|
||||||
|
"target": "http://localhost:8999/",
|
||||||
|
"secure": false,
|
||||||
|
"ws": true
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,8 +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';
|
||||||
|
|
||||||
const WEB_SOCKET_PROTOCOL = (document.location.protocol == 'https:') ? 'wss:' : 'ws:';
|
const WEB_SOCKET_PROTOCOL = (document.location.protocol === 'https:') ? 'wss:' : 'ws:';
|
||||||
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + '/ws';
|
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + ':' + document.location.port + '/ws';
|
||||||
const API_BASE_URL = '/api/v1';
|
const API_BASE_URL = '/api/v1';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|
Loading…
Add table
Reference in a new issue