@libp2p/webrtc 5.2.0-2b49a5f74 → 5.2.0-d98cc46e4

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 CHANGED
@@ -56,6 +56,7 @@ import { circuitRelayTransport, circuitRelayServer } from '@libp2p/circuit-relay
56
56
  import { identify } from '@libp2p/identify'
57
57
  import { webRTC } from '@libp2p/webrtc'
58
58
  import { webSockets } from '@libp2p/websockets'
59
+ import * as filters from '@libp2p/websockets/filters'
59
60
  import { WebRTC } from '@multiformats/multiaddr-matcher'
60
61
  import delay from 'delay'
61
62
  import { pipe } from 'it-pipe'
@@ -69,13 +70,10 @@ const relay = await createLibp2p({
69
70
  listen: ['/ip4/127.0.0.1/tcp/0/ws']
70
71
  },
71
72
  transports: [
72
- webSockets()
73
+ webSockets({filter: filters.all})
73
74
  ],
74
75
  connectionEncrypters: [noise()],
75
76
  streamMuxers: [yamux()],
76
- connectionGater: {
77
- denyDialMultiaddr: () => false
78
- },
79
77
  services: {
80
78
  identify: identify(),
81
79
  relay: circuitRelayServer()
@@ -93,15 +91,12 @@ const listener = await createLibp2p({
93
91
  ]
94
92
  },
95
93
  transports: [
96
- webSockets(),
94
+ webSockets({filter: filters.all}),
97
95
  webRTC(),
98
96
  circuitRelayTransport()
99
97
  ],
100
98
  connectionEncrypters: [noise()],
101
99
  streamMuxers: [yamux()],
102
- connectionGater: {
103
- denyDialMultiaddr: () => false
104
- },
105
100
  services: {
106
101
  identify: identify(),
107
102
  echo: echo()
@@ -133,15 +128,12 @@ while (true) {
133
128
  // direct WebRTC connection
134
129
  const dialer = await createLibp2p({
135
130
  transports: [
136
- webSockets(),
131
+ webSockets({filter: filters.all}),
137
132
  webRTC(),
138
133
  circuitRelayTransport()
139
134
  ],
140
135
  connectionEncrypters: [noise()],
141
136
  streamMuxers: [yamux()],
142
- connectionGater: {
143
- denyDialMultiaddr: () => false
144
- },
145
137
  services: {
146
138
  identify: identify(),
147
139
  echo: echo()
@@ -33,6 +33,7 @@
33
33
  * import { identify } from '@libp2p/identify'
34
34
  * import { webRTC } from '@libp2p/webrtc'
35
35
  * import { webSockets } from '@libp2p/websockets'
36
+ * import * as filters from '@libp2p/websockets/filters'
36
37
  * import { WebRTC } from '@multiformats/multiaddr-matcher'
37
38
  * import delay from 'delay'
38
39
  * import { pipe } from 'it-pipe'
@@ -46,13 +47,10 @@
46
47
  * listen: ['/ip4/127.0.0.1/tcp/0/ws']
47
48
  * },
48
49
  * transports: [
49
- * webSockets()
50
+ * webSockets({filter: filters.all})
50
51
  * ],
51
52
  * connectionEncrypters: [noise()],
52
53
  * streamMuxers: [yamux()],
53
- * connectionGater: {
54
- * denyDialMultiaddr: () => false
55
- * },
56
54
  * services: {
57
55
  * identify: identify(),
58
56
  * relay: circuitRelayServer()
@@ -70,15 +68,12 @@
70
68
  * ]
71
69
  * },
72
70
  * transports: [
73
- * webSockets(),
71
+ * webSockets({filter: filters.all}),
74
72
  * webRTC(),
75
73
  * circuitRelayTransport()
76
74
  * ],
77
75
  * connectionEncrypters: [noise()],
78
76
  * streamMuxers: [yamux()],
79
- * connectionGater: {
80
- * denyDialMultiaddr: () => false
81
- * },
82
77
  * services: {
83
78
  * identify: identify(),
84
79
  * echo: echo()
@@ -110,15 +105,12 @@
110
105
  * // direct WebRTC connection
111
106
  * const dialer = await createLibp2p({
112
107
  * transports: [
113
- * webSockets(),
108
+ * webSockets({filter: filters.all}),
114
109
  * webRTC(),
115
110
  * circuitRelayTransport()
116
111
  * ],
117
112
  * connectionEncrypters: [noise()],
118
113
  * streamMuxers: [yamux()],
119
- * connectionGater: {
120
- * denyDialMultiaddr: () => false
121
- * },
122
114
  * services: {
123
115
  * identify: identify(),
124
116
  * echo: echo()
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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U,EAAE,+BAA+B,KAAK,SAAS,CAEnH;AAED,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,CAAA;AAE9D,iBAAS,MAAM,CAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,CAAC,UAAU,EAAE,yBAAyB,KAAK,SAAS,CAEjG;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
package/dist/src/index.js CHANGED
@@ -33,6 +33,7 @@
33
33
  * import { identify } from '@libp2p/identify'
34
34
  * import { webRTC } from '@libp2p/webrtc'
35
35
  * import { webSockets } from '@libp2p/websockets'
36
+ * import * as filters from '@libp2p/websockets/filters'
36
37
  * import { WebRTC } from '@multiformats/multiaddr-matcher'
37
38
  * import delay from 'delay'
38
39
  * import { pipe } from 'it-pipe'
@@ -46,13 +47,10 @@
46
47
  * listen: ['/ip4/127.0.0.1/tcp/0/ws']
47
48
  * },
48
49
  * transports: [
49
- * webSockets()
50
+ * webSockets({filter: filters.all})
50
51
  * ],
51
52
  * connectionEncrypters: [noise()],
52
53
  * streamMuxers: [yamux()],
53
- * connectionGater: {
54
- * denyDialMultiaddr: () => false
55
- * },
56
54
  * services: {
57
55
  * identify: identify(),
58
56
  * relay: circuitRelayServer()
@@ -70,15 +68,12 @@
70
68
  * ]
71
69
  * },
72
70
  * transports: [
73
- * webSockets(),
71
+ * webSockets({filter: filters.all}),
74
72
  * webRTC(),
75
73
  * circuitRelayTransport()
76
74
  * ],
77
75
  * connectionEncrypters: [noise()],
78
76
  * streamMuxers: [yamux()],
79
- * connectionGater: {
80
- * denyDialMultiaddr: () => false
81
- * },
82
77
  * services: {
83
78
  * identify: identify(),
84
79
  * echo: echo()
@@ -110,15 +105,12 @@
110
105
  * // direct WebRTC connection
111
106
  * const dialer = await createLibp2p({
112
107
  * transports: [
113
- * webSockets(),
108
+ * webSockets({filter: filters.all}),
114
109
  * webRTC(),
115
110
  * circuitRelayTransport()
116
111
  * ],
117
112
  * connectionEncrypters: [noise()],
118
113
  * streamMuxers: [yamux()],
119
- * connectionGater: {
120
- * denyDialMultiaddr: () => false
121
- * },
122
114
  * services: {
123
115
  * identify: identify(),
124
116
  * echo: echo()
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgNG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAwE,MAAM,kCAAkC,CAAA;AA2E9I,SAAS,YAAY,CAAE,IAAgC;IACrD,OAAO,CAAC,UAA2C,EAAE,EAAE,CAAC,IAAI,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrG,CAAC;AAID,SAAS,MAAM,CAAE,IAA0B;IACzC,OAAO,CAAC,UAAqC,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzF,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAwE,MAAM,kCAAkC,CAAA;AA2E9I,SAAS,YAAY,CAAE,IAAgC;IACrD,OAAO,CAAC,UAA2C,EAAE,EAAE,CAAC,IAAI,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrG,CAAC;AAID,SAAS,MAAM,CAAE,IAA0B;IACzC,OAAO,CAAC,UAAqC,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzF,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/webrtc",
3
- "version": "5.2.0-2b49a5f74",
3
+ "version": "5.2.0-d98cc46e4",
4
4
  "description": "A libp2p transport using WebRTC connections",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme",
@@ -54,10 +54,10 @@
54
54
  "@chainsafe/is-ip": "^2.0.2",
55
55
  "@chainsafe/libp2p-noise": "^16.0.0",
56
56
  "@ipshipyard/node-datachannel": "^0.26.4",
57
- "@libp2p/interface": "2.6.0-2b49a5f74",
58
- "@libp2p/interface-internal": "2.3.2-2b49a5f74",
59
- "@libp2p/peer-id": "5.0.13-2b49a5f74",
60
- "@libp2p/utils": "6.5.2-2b49a5f74",
57
+ "@libp2p/interface": "2.6.0-d98cc46e4",
58
+ "@libp2p/interface-internal": "2.3.2-d98cc46e4",
59
+ "@libp2p/peer-id": "5.0.13-d98cc46e4",
60
+ "@libp2p/utils": "6.5.2-d98cc46e4",
61
61
  "@multiformats/multiaddr": "^12.4.0",
62
62
  "@multiformats/multiaddr-matcher": "^1.6.0",
63
63
  "@peculiar/webcrypto": "^1.5.0",
@@ -83,9 +83,9 @@
83
83
  "uint8arrays": "^5.1.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@libp2p/crypto": "5.0.12-2b49a5f74",
87
- "@libp2p/interface-compliance-tests": "6.3.2-2b49a5f74",
88
- "@libp2p/logger": "5.1.9-2b49a5f74",
86
+ "@libp2p/crypto": "5.0.12-d98cc46e4",
87
+ "@libp2p/interface-compliance-tests": "6.3.2-d98cc46e4",
88
+ "@libp2p/logger": "5.1.9-d98cc46e4",
89
89
  "@types/sinon": "^17.0.3",
90
90
  "aegir": "^45.0.5",
91
91
  "delay": "^6.0.0",
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@
33
33
  * import { identify } from '@libp2p/identify'
34
34
  * import { webRTC } from '@libp2p/webrtc'
35
35
  * import { webSockets } from '@libp2p/websockets'
36
+ * import * as filters from '@libp2p/websockets/filters'
36
37
  * import { WebRTC } from '@multiformats/multiaddr-matcher'
37
38
  * import delay from 'delay'
38
39
  * import { pipe } from 'it-pipe'
@@ -46,13 +47,10 @@
46
47
  * listen: ['/ip4/127.0.0.1/tcp/0/ws']
47
48
  * },
48
49
  * transports: [
49
- * webSockets()
50
+ * webSockets({filter: filters.all})
50
51
  * ],
51
52
  * connectionEncrypters: [noise()],
52
53
  * streamMuxers: [yamux()],
53
- * connectionGater: {
54
- * denyDialMultiaddr: () => false
55
- * },
56
54
  * services: {
57
55
  * identify: identify(),
58
56
  * relay: circuitRelayServer()
@@ -70,15 +68,12 @@
70
68
  * ]
71
69
  * },
72
70
  * transports: [
73
- * webSockets(),
71
+ * webSockets({filter: filters.all}),
74
72
  * webRTC(),
75
73
  * circuitRelayTransport()
76
74
  * ],
77
75
  * connectionEncrypters: [noise()],
78
76
  * streamMuxers: [yamux()],
79
- * connectionGater: {
80
- * denyDialMultiaddr: () => false
81
- * },
82
77
  * services: {
83
78
  * identify: identify(),
84
79
  * echo: echo()
@@ -110,15 +105,12 @@
110
105
  * // direct WebRTC connection
111
106
  * const dialer = await createLibp2p({
112
107
  * transports: [
113
- * webSockets(),
108
+ * webSockets({filter: filters.all}),
114
109
  * webRTC(),
115
110
  * circuitRelayTransport()
116
111
  * ],
117
112
  * connectionEncrypters: [noise()],
118
113
  * streamMuxers: [yamux()],
119
- * connectionGater: {
120
- * denyDialMultiaddr: () => false
121
- * },
122
114
  * services: {
123
115
  * identify: identify(),
124
116
  * echo: echo()