summaryrefslogtreecommitdiffhomepage
path: root/app/lib/backend.js
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-09-12 13:33:46 +0200
committerErik Larkö <erik@mullvad.net>2017-09-12 13:46:04 +0200
commit4ed0102b38aa29bee9b0a876ec48c48d715f644e (patch)
tree4c3334ed98f97b2c83c9b49f448c790810a5f835 /app/lib/backend.js
parentd541f4ee98182faa6c4e52727c948612b4d7ad53 (diff)
downloadmullvadvpn-4ed0102b38aa29bee9b0a876ec48c48d715f644e.tar.xz
mullvadvpn-4ed0102b38aa29bee9b0a876ec48c48d715f644e.zip
Move the hardcoded relay endpoint data to the Connect component
Diffstat (limited to 'app/lib/backend.js')
-rw-r--r--app/lib/backend.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index 9d1fb21d35..b17b163a85 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -11,6 +11,7 @@ import { push } from 'react-router-redux';
import type { BackendState } from './ipc-facade';
import type { ConnectionState } from '../redux/connection/reducers';
+import type { RelayEndpoint } from './ipc-facade';
export type EventType = 'connect' | 'connecting' | 'disconnect' | 'login' | 'logging' | 'logout' | 'updatedIp' | 'updatedLocation' | 'updatedReachability';
export type ErrorType = 'NO_CREDIT' | 'NO_INTERNET' | 'INVALID_ACCOUNT';
@@ -227,17 +228,16 @@ export class Backend {
});
}
- connect(addr: string): Promise<void> {
+ connect(relayEndpoint: RelayEndpoint): Promise<void> {
- this._store.dispatch(connectionActions.connectingTo(addr));
+ this._store.dispatch(connectionActions.connectingTo(relayEndpoint));
- // TODO: Don't hardcode these values
- return this._ipc.setCustomRelay(addr, 1300, 'udp')
+ return this._ipc.setCustomRelay(relayEndpoint)
.then( () => {
return this._ipc.connect();
})
.catch(e => {
- log.info('Failed connecting to', addr, e);
+ log.info('Failed connecting to', relayEndpoint.host, '-', e.message);
this._store.dispatch(connectionActions.disconnected());
});
}