connect to localhost:8767 on electron

This commit is contained in:
Martti Malmi 2020-01-28 14:40:02 +02:00
parent 28791a031b
commit b366b6c998
2 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<meta name="description" content="Social Networking Freedom">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta property="og:title" content="Iris Messenger" />
<meta property="og:description" content="Social Networking Freedom" />
<meta property="og:description" content="Encrypted P2P Messaging" />
<meta property="og:url" content="https://iris.to" />
<meta property="og:image" content="https://iris.to/img/cover.jpg" />
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

View File

@ -1,6 +1,9 @@
var gun = Gun({
peers: ['http://localhost:8765/gun', 'https://gun-us.herokuapp.com/gun', 'https://gunjs.herokuapp.com/gun']
});
var isElectron = (userAgent.indexOf(' electron/') > -1);
var peers = ['https://gun-us.herokuapp.com/gun', 'https://gunjs.herokuapp.com/gun'];
if (isElectron) {
peers.push('http://localhost:8767/gun');
}
var gun = Gun({peers});
window.gun = gun;
var notificationSound = new Audio('./notification.mp3');
var chat = gun.get('converse/' + location.hash.slice(1));