Proxy websocket when running local environment.

This commit is contained in:
Simon Lindh 2019-08-29 01:05:46 +02:00
parent e95b90b857
commit 53269a805b
3 changed files with 9 additions and 4 deletions

View file

@ -50,8 +50,8 @@ class MempoolSpace {
statistics.startStatistics();
fiatConversion.startService();
let opts = {
host: "127.0.0.1",
const opts = {
host: '127.0.0.1',
port: 8999
};
this.server.listen(opts, () => {

View file

@ -2,5 +2,10 @@
"/api": {
"target": "http://localhost:8999/",
"secure": false
},
"/ws": {
"target": "http://localhost:8999/",
"secure": false,
"ws": true
}
}

View file

@ -6,8 +6,8 @@ import { Observable } from 'rxjs';
import { MemPoolService } from './mem-pool.service';
import { tap, retryWhen, delay } from 'rxjs/operators';
const WEB_SOCKET_PROTOCOL = (document.location.protocol == 'https:') ? 'wss:' : 'ws:';
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + '/ws';
const WEB_SOCKET_PROTOCOL = (document.location.protocol === 'https:') ? 'wss:' : 'ws:';
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + ':' + document.location.port + '/ws';
const API_BASE_URL = '/api/v1';
@Injectable({