{"action":"created","issue":{"url":"https://api.github.com/repos/amark/gun/issues/506","repository_url":"https://api.github.com/repos/amark/gun","labels_url":"https://api.github.com/repos/amark/gun/issues/506/labels{/name}","comments_url":"https://api.github.com/repos/amark/gun/issues/506/comments","events_url":"https://api.github.com/repos/amark/gun/issues/506/events","html_url":"https://github.com/amark/gun/issues/506","id":299838435,"number":506,"title":"Can 2 (or more) browsers communicate as peers even when they are offline ?","user":{"login":"jalchr","id":295421,"avatar_url":"https://avatars1.githubusercontent.com/u/295421?v=4","gravatar_id":"","url":"https://api.github.com/users/jalchr","html_url":"https://github.com/jalchr","followers_url":"https://api.github.com/users/jalchr/followers","following_url":"https://api.github.com/users/jalchr/following{/other_user}","gists_url":"https://api.github.com/users/jalchr/gists{/gist_id}","starred_url":"https://api.github.com/users/jalchr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jalchr/subscriptions","organizations_url":"https://api.github.com/users/jalchr/orgs","repos_url":"https://api.github.com/users/jalchr/repos","events_url":"https://api.github.com/users/jalchr/events{/privacy}","received_events_url":"https://api.github.com/users/jalchr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-23T20:21:18Z","updated_at":"2018-02-23T21:07:27Z","closed_at":null,"author_association":"NONE","body":"Sorry if this question looks trivial. \r\nI'm having this question https://stackoverflow.com/questions/48908655/how-can-a-number-of-angular-clients-communicate-between-themselves-even-when-the/48909071?noredirect=1#comment84913140_48909071 \r\n\r\nI wonder if gun works offline as a database medium inside the browser... \r\nI.e. Can 2 browsers communicate even when both are offline ?\r\nif so... any guides would be great.\r\n\r\nMany thanks"},"comment":{"url":"https://api.github.com/repos/amark/gun/issues/comments/368138782","html_url":"https://github.com/amark/gun/issues/506#issuecomment-368138782","issue_url":"https://api.github.com/repos/amark/gun/issues/506","id":368138782,"user":{"login":"amark","id":433412,"avatar_url":"https://avatars1.githubusercontent.com/u/433412?v=4","gravatar_id":"","url":"https://api.github.com/users/amark","html_url":"https://github.com/amark","followers_url":"https://api.github.com/users/amark/followers","following_url":"https://api.github.com/users/amark/following{/other_user}","gists_url":"https://api.github.com/users/amark/gists{/gist_id}","starred_url":"https://api.github.com/users/amark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amark/subscriptions","organizations_url":"https://api.github.com/users/amark/orgs","repos_url":"https://api.github.com/users/amark/repos","events_url":"https://api.github.com/users/amark/events{/privacy}","received_events_url":"https://api.github.com/users/amark/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T21:07:27Z","updated_at":"2018-02-23T21:07:27Z","author_association":"OWNER","body":"@jalchr it'd be appreciated if you could move this (and my answer) into a StackOverflow question tagged with GUN, as it isn't a bug. Here is my reply:\r\n\r\n1. Since GUN can connect to multiple peers, you can have the browser connect to both outside/external servers AND peers running on your local area network. All you have to do is `npm install gun` and then `npm start` it on a few machines within your LAN and then hardcode/refresh/update their local IPs in the browser app (perhaps could even use GUN to do that, by storing/syncing a table of local IPs as the update/change)\r\n\r\n2. Ideally we would all use WebRTC and have our browsers connect to each other directly. This is possible **however** has a **big problem**, WebRTC depends upon a relay/signal server every time the browser is refreshed. This is kinda stupid and is the browser/WebRTC's fault, not GUN (or other P2P systems). So either way, you'd have to also do (1) either way.\r\n\r\n3. If you are on the same computer, in the same browser, in the same browser session, it is possible to relay changes (although I didn't bother to code for this, as it is kinda useless behavior) - it wouldn't work with other machines in your LAN.\r\n\r\nSummary: As long as you are running some local peers within your network, and can access them locally, then you can do \"offline\" (where offline here is referencing external/outside network) sync with GUN.\r\n\r\nGUN is also offline-first in that, even if 2 machines are truly disconnected, if they make local edits while they are offline, they will sync properly when the machines eventually come back online/reconnect.\r\n\r\nI hope this helps."}}
{"actor":{"display_login":"amark"}}