mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
MULTICAST!!! RAD * update, start start
This commit is contained in:
parent
1e20fd5761
commit
d947059d5c
17
examples/start.js.html
Normal file
17
examples/start.js.html
Normal file
@ -0,0 +1,17 @@
|
||||
/*<!DOCTYPE html>
|
||||
<html>
|
||||
<head></head>
|
||||
<body></body>
|
||||
<script>// */
|
||||
;(function(){try{
|
||||
if(typeof window == "undefined"){ return }
|
||||
var url = location.hash.slice(1);
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = function(e){
|
||||
if(4 != xhr.readyState){ return }
|
||||
document.write(xhr.responseText);
|
||||
};
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send(null);
|
||||
}catch(e){document.write(''+e)}}());
|
||||
//</script></html>
|
2
gun.js
2
gun.js
@ -2067,7 +2067,7 @@
|
||||
peer.say(raw);
|
||||
} else
|
||||
if(wire.send){
|
||||
if(wire.readyState && 1 != wire.readyState){ return }
|
||||
if(wire.readyState && 1 != wire.readyState){ throw "socket not ready yet!" }
|
||||
wire.send(raw);
|
||||
}
|
||||
}catch(e){
|
||||
|
5
lib/hub.js
Normal file
5
lib/hub.js
Normal file
@ -0,0 +1,5 @@
|
||||
var fs = require('fs');
|
||||
|
||||
fs.watch('.', {persistent: false, recursive: true}, function(eve, name){
|
||||
console.log("changed!", eve, name);
|
||||
})
|
@ -1,3 +1,4 @@
|
||||
console.log("IPFS PLUGIN NOT OFFICIALLY MAINTAINED! PROBABLY WON'T WORK! USE AT YOUR OWN RISK! PLEASE CONTRIBUTE FIXES!");
|
||||
var opt = gun._.opt, u;
|
||||
if (u === opt.ipfs.directory) {
|
||||
opt.ipfs.directory = '/gun';
|
||||
|
10
lib/store.js
10
lib/store.js
@ -35,21 +35,21 @@ Gun.on('create', function(root){
|
||||
|
||||
root.on('get', function(msg){
|
||||
this.to.next(msg);
|
||||
var id = msg['#'], get = msg.get, soul = msg.get['#'], has = msg.get['.']||'', opt = {}, graph, lex, key, tmp;
|
||||
var id = msg['#'], get = msg.get, soul = msg.get['#'], has = msg.get['.']||'', opt = {}, graph, lex, key, tmp, force;
|
||||
if(typeof soul == 'string'){
|
||||
key = soul;
|
||||
} else
|
||||
if(soul){
|
||||
if(tmp = soul['*']){ opt.limit = 1 }
|
||||
key = tmp || soul['='];
|
||||
if(u !== (tmp = soul['*'])){ opt.limit = force = 1 }
|
||||
key = force? (''+tmp) : tmp || soul['='];
|
||||
}
|
||||
if(key && !opt.limit){ // a soul.has must be on a soul, and not during soul*
|
||||
if(typeof has == 'string'){
|
||||
key = key+esc+(opt.atom = has);
|
||||
} else
|
||||
if(has){
|
||||
if(tmp = has['*']){ opt.limit = 1 }
|
||||
if(key){ key = key+esc + (tmp || (opt.atom = has['='])) }
|
||||
if(u !== (tmp = has['*'])){ opt.limit = force = 1 }
|
||||
if(key){ key = key+esc + (force? (''+tmp) : tmp || (opt.atom = has['='])) }
|
||||
}
|
||||
}
|
||||
if((tmp = get['%']) || opt.limit){
|
||||
|
@ -74,7 +74,7 @@ Gun.on('opt', function(root){
|
||||
wire.on('message', function(msg){
|
||||
opt.mesh.hear(msg.data || msg, peer);
|
||||
});
|
||||
wire.on('close', function(a,b,c){
|
||||
wire.on('close', function(){
|
||||
opt.mesh.bye(peer);
|
||||
});
|
||||
wire.on('error', function(e){});
|
||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.2019.413",
|
||||
"version": "0.2019.416",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -724,9 +724,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
|
||||
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==",
|
||||
"version": "2.13.2",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
|
||||
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
|
||||
"optional": true
|
||||
},
|
||||
"negotiator": {
|
||||
@ -736,15 +736,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"node-webcrypto-ossl": {
|
||||
"version": "1.0.39",
|
||||
"resolved": "https://registry.npmjs.org/node-webcrypto-ossl/-/node-webcrypto-ossl-1.0.39.tgz",
|
||||
"integrity": "sha512-cEq67y6GJ5jcKdANi5XqejqMvM/eIGxuOOE8F+c0XS950jSpvOcjUNHLmIe3/dN/UKyUkb+dri0BU4OgmCJd2g==",
|
||||
"version": "1.0.43",
|
||||
"resolved": "https://registry.npmjs.org/node-webcrypto-ossl/-/node-webcrypto-ossl-1.0.43.tgz",
|
||||
"integrity": "sha512-AavMGbUB2MaTzli0+swjSAr4aLqf9M5jHIrs5VP9EUDXyEaIOyyio3H1z3pZCxKpaDD9coKWD3bWAiaIBuN8wg==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"nan": "^2.11.1",
|
||||
"nan": "^2.12.1",
|
||||
"tslib": "^1.9.3",
|
||||
"webcrypto-core": "^0.1.25"
|
||||
"webcrypto-core": "^0.1.26"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.2019.413",
|
||||
"version": "0.2019.416",
|
||||
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
||||
"main": "index.js",
|
||||
"browser": "gun.js",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"text-encoding": "^0.7.0",
|
||||
"node-webcrypto-ossl": "^1.0.39"
|
||||
"node-webcrypto-ossl": "^1.0.43"
|
||||
},
|
||||
"devDependencies": {
|
||||
"aws-sdk": ">=2.153.0",
|
||||
|
@ -16,8 +16,8 @@
|
||||
</ul>
|
||||
<div id='debug'></div>
|
||||
<script>
|
||||
try{localStorage.clear()}catch(e){};
|
||||
indexedDB.deleteDatabase('radata');
|
||||
//try{localStorage.clear()}catch(e){};
|
||||
//indexedDB.deleteDatabase('radata');
|
||||
//var gun = Gun('http://localhost:8765/gun');
|
||||
var gun = Gun({localStorage: false});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user