webpeerjs 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/package.json +4 -4
- package/src/webpeer.js +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# WebPEER
|
|
2
2
|
|
|
3
|
-
WebPEER is a P2P Network that Runs
|
|
3
|
+
WebPEER is a Decentralized P2P Network that Runs on Standard Browser. It allows developers to build peer-to-peer webapps without relying on centralized servers or specialized browsers. Aims to return internet control back to users.
|
|
4
4
|
|
|
5
5
|
[>DEMO<](https://nuzulul.github.io/webpeerjs/demo/chat.html)
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
+
## Library
|
|
10
|
+
|
|
11
|
+
- [WebPEER.js](https://www.npmjs.com/package/webpeerjs) - JavaScript implementation designed as minimal, low level API provided to build decentralized P2P webapss on top WebPEER Network. Internally, it uses libp2p modular JavaScript stack as its engine.
|
|
12
|
+
|
|
9
13
|
## Security
|
|
10
14
|
|
|
11
15
|
WebPEER Network run over [`libp2p gossipsub`](https://docs.libp2p.io/concepts/security/security-considerations/#publish--subscribe) protocol to enables communication between peers.
|
|
@@ -15,11 +19,11 @@ WebPEER Network run over [`libp2p gossipsub`](https://docs.libp2p.io/concepts/se
|
|
|
15
19
|
|
|
16
20
|
## Benefit
|
|
17
21
|
|
|
18
|
-
* ✅
|
|
22
|
+
* ✅ Decentralized P2P Network
|
|
19
23
|
* ✅ Scalable Peers
|
|
20
24
|
* ✅ Accessible in Standard Browser
|
|
21
|
-
* ✅ Broadcast Channel
|
|
22
|
-
* ✅ No
|
|
25
|
+
* ✅ Broadcast Channel Provided
|
|
26
|
+
* ✅ No Server Required
|
|
23
27
|
* ✅ Freedom
|
|
24
28
|
|
|
25
29
|
## Ideas
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpeerjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "WebPEER is P2P Network that Runs
|
|
5
|
+
"description": "WebPEER is P2P Network that Runs on Standard Browser",
|
|
6
6
|
"main": "./src/webpeer.js",
|
|
7
7
|
"module": "./src/webpeer.js",
|
|
8
8
|
"exports": {
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"it-map": "^3.1.6",
|
|
71
71
|
"it-pipe": "^3.0.1",
|
|
72
72
|
"libp2p": "^3.3.4",
|
|
73
|
-
"multiformats": "^14.0.
|
|
73
|
+
"multiformats": "^14.0.3",
|
|
74
74
|
"protons-runtime": "^7.0.0",
|
|
75
|
-
"signalingserver.js": "^0.0.
|
|
75
|
+
"signalingserver.js": "^0.0.7",
|
|
76
76
|
"uint8arrays": "^6.1.1"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/src/webpeer.js
CHANGED
|
@@ -660,9 +660,9 @@ class webpeerjs{
|
|
|
660
660
|
peer.addresses.forEach((address)=>{
|
|
661
661
|
const addr = address.multiaddr.toString()+'/p2p/'+id
|
|
662
662
|
if(config.CONFIG_DIAL_WEBSOCKET_FIRST){
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
if(addr.includes('/webtransport/') || addr.includes('/ws/') || addr.includes('/wss/')){
|
|
664
|
+
addrs.push(addr)
|
|
665
|
+
}
|
|
666
666
|
}else{
|
|
667
667
|
if(addr.includes('webtransport') && addr.includes('certhash')){
|
|
668
668
|
addrs.push(addr)
|
|
@@ -1630,7 +1630,7 @@ class webpeerjs{
|
|
|
1630
1630
|
|
|
1631
1631
|
if(method === 'default' && peers === 0){
|
|
1632
1632
|
this.#dialDefaultBootstarp();
|
|
1633
|
-
setTimeout(()=>this.#dialKnownPeers('
|
|
1633
|
+
setTimeout(()=>this.#dialKnownPeers('dnsonly'), config.CONFIG_TIMEOUT_DIAL_KNOWN_PEERS);
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
1636
|
if(method === 'webtransport' && peers === 0){
|