mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-19 17:46:33 +00:00
if on localhost, connect to it (except if port 8080)
This commit is contained in:
parent
e2e2cdaec5
commit
bbeeed77ac
@ -9,11 +9,14 @@ const ELECTRON_GUN_URL = 'http://localhost:8767/gun';
|
||||
let maxConnectedPeers = Helpers.isElectron ? 2 : 1;
|
||||
const DEFAULT_PEERS = {};
|
||||
|
||||
if (window.location.hostname.endsWith('herokuapp.com') || window.location.host === 'localhost:4944') {
|
||||
DEFAULT_PEERS[window.location.origin + '/gun'] = {};
|
||||
} else {
|
||||
DEFAULT_PEERS['https://gun-rs.iris.to/gun'] = {};
|
||||
DEFAULT_PEERS['https://gun-us.herokuapp.com/gun'] = {};
|
||||
DEFAULT_PEERS['https://gun-rs.iris.to/gun'] = {};
|
||||
DEFAULT_PEERS['https://gun-us.herokuapp.com/gun'] = {};
|
||||
const loc = window.location;
|
||||
const host = loc.host;
|
||||
const is_localhost_but_not_dev = host.startsWith('localhost') && host !== 'localhost:8080';
|
||||
if (loc.hostname.endsWith('herokuapp.com') || is_localhost_but_not_dev) {
|
||||
Object.keys(DEFAULT_PEERS).forEach(url => DEFAULT_PEERS[url].enabled = false);
|
||||
DEFAULT_PEERS[loc.origin + '/gun'] = {enabled: true};
|
||||
}
|
||||
|
||||
let knownPeers = getSavedPeers();
|
||||
|
Loading…
Reference in New Issue
Block a user