@streamr/dht 100.0.0-pretestnet.0 → 100.0.0-pretestnet.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.
Files changed (317) hide show
  1. package/dist/src/connection/ConnectionLockHandler.d.ts +7 -8
  2. package/dist/src/connection/ConnectionLockHandler.js +16 -14
  3. package/dist/src/connection/ConnectionLockHandler.js.map +1 -1
  4. package/dist/src/connection/ConnectionLockRpcLocal.d.ts +20 -0
  5. package/dist/src/connection/ConnectionLockRpcLocal.js +47 -0
  6. package/dist/src/connection/ConnectionLockRpcLocal.js.map +1 -0
  7. package/dist/src/connection/ConnectionLockRpcRemote.d.ts +4 -3
  8. package/dist/src/connection/ConnectionLockRpcRemote.js +6 -6
  9. package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -1
  10. package/dist/src/connection/ConnectionManager.d.ts +5 -8
  11. package/dist/src/connection/ConnectionManager.js +77 -107
  12. package/dist/src/connection/ConnectionManager.js.map +1 -1
  13. package/dist/src/connection/ConnectivityChecker.d.ts +7 -6
  14. package/dist/src/connection/ConnectivityChecker.js +23 -20
  15. package/dist/src/connection/ConnectivityChecker.js.map +1 -1
  16. package/dist/src/connection/ConnectorFacade.d.ts +15 -12
  17. package/dist/src/connection/ConnectorFacade.js +61 -26
  18. package/dist/src/connection/ConnectorFacade.js.map +1 -1
  19. package/dist/src/connection/Handshaker.d.ts +2 -2
  20. package/dist/src/connection/Handshaker.js +28 -28
  21. package/dist/src/connection/Handshaker.js.map +1 -1
  22. package/dist/src/connection/IConnection.d.ts +5 -6
  23. package/dist/src/connection/IConnection.js.map +1 -1
  24. package/dist/src/connection/ManagedConnection.d.ts +3 -4
  25. package/dist/src/connection/ManagedConnection.js +30 -30
  26. package/dist/src/connection/ManagedConnection.js.map +1 -1
  27. package/dist/src/connection/ManagedWebrtcConnection.d.ts +7 -0
  28. package/dist/src/connection/ManagedWebrtcConnection.js +20 -0
  29. package/dist/src/connection/ManagedWebrtcConnection.js.map +1 -0
  30. package/dist/src/connection/{Simulator → simulator}/Simulator.js +3 -3
  31. package/dist/src/connection/{Simulator → simulator}/Simulator.js.map +1 -1
  32. package/dist/src/connection/{Simulator → simulator}/SimulatorConnection.d.ts +3 -4
  33. package/dist/src/connection/{Simulator → simulator}/SimulatorConnection.js +22 -22
  34. package/dist/src/connection/simulator/SimulatorConnection.js.map +1 -0
  35. package/dist/src/connection/{Simulator → simulator}/SimulatorConnector.d.ts +2 -2
  36. package/dist/src/connection/{Simulator → simulator}/SimulatorConnector.js +11 -11
  37. package/dist/src/connection/{Simulator → simulator}/SimulatorConnector.js.map +1 -1
  38. package/dist/src/connection/{Simulator → simulator}/SimulatorTransport.d.ts +1 -1
  39. package/dist/src/connection/{Simulator → simulator}/SimulatorTransport.js +2 -2
  40. package/dist/src/connection/simulator/SimulatorTransport.js.map +1 -0
  41. package/dist/src/connection/{Simulator → simulator}/pings.js.map +1 -1
  42. package/dist/src/connection/{WebRTC/IWebRtcConnection.d.ts → webrtc/IWebrtcConnection.d.ts} +2 -2
  43. package/dist/src/connection/{WebRTC/IWebRtcConnection.js → webrtc/IWebrtcConnection.js} +1 -1
  44. package/dist/src/connection/webrtc/IWebrtcConnection.js.map +1 -0
  45. package/dist/src/connection/{WebRTC/NodeWebRtcConnection.d.ts → webrtc/NodeWebrtcConnection.d.ts} +6 -7
  46. package/dist/src/connection/{WebRTC/NodeWebRtcConnection.js → webrtc/NodeWebrtcConnection.js} +36 -36
  47. package/dist/src/connection/webrtc/NodeWebrtcConnection.js.map +1 -0
  48. package/dist/src/connection/webrtc/WebrtcConnector.d.ts +38 -0
  49. package/dist/src/connection/webrtc/WebrtcConnector.js +178 -0
  50. package/dist/src/connection/webrtc/WebrtcConnector.js.map +1 -0
  51. package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.d.ts +26 -0
  52. package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js +99 -0
  53. package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js.map +1 -0
  54. package/dist/src/connection/{WebRTC/WebRtcConnectorRpcRemote.d.ts → webrtc/WebrtcConnectorRpcRemote.d.ts} +4 -4
  55. package/dist/src/connection/{WebRTC/WebRtcConnectorRpcRemote.js → webrtc/WebrtcConnectorRpcRemote.js} +6 -8
  56. package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.js.map +1 -0
  57. package/dist/src/connection/{WebRTC → webrtc}/iceServerAsString.d.ts +1 -1
  58. package/dist/src/connection/{WebRTC → webrtc}/iceServerAsString.js.map +1 -1
  59. package/dist/src/connection/websocket/AutoCertifierClientFacade.d.ts +26 -0
  60. package/dist/src/connection/websocket/AutoCertifierClientFacade.js +37 -0
  61. package/dist/src/connection/websocket/AutoCertifierClientFacade.js.map +1 -0
  62. package/dist/src/connection/{WebSocket/ClientWebSocket.d.ts → websocket/ClientWebsocket.d.ts} +5 -4
  63. package/dist/src/connection/{WebSocket/ClientWebSocket.js → websocket/ClientWebsocket.js} +20 -16
  64. package/dist/src/connection/websocket/ClientWebsocket.js.map +1 -0
  65. package/dist/src/connection/{WebSocket/ServerWebSocket.d.ts → websocket/ServerWebsocket.d.ts} +2 -2
  66. package/dist/src/connection/{WebSocket/ServerWebSocket.js → websocket/ServerWebsocket.js} +23 -27
  67. package/dist/src/connection/websocket/ServerWebsocket.js.map +1 -0
  68. package/dist/src/connection/{WebSocket/WebSocketConnectorRpcLocal.d.ts → websocket/WebsocketConnector.d.ts} +23 -15
  69. package/dist/src/connection/{WebSocket/WebSocketConnectorRpcLocal.js → websocket/WebsocketConnector.js} +108 -102
  70. package/dist/src/connection/websocket/WebsocketConnector.js.map +1 -0
  71. package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.d.ts +17 -0
  72. package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js +26 -0
  73. package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js.map +1 -0
  74. package/dist/src/connection/{WebSocket/WebSocketConnectorRpcRemote.d.ts → websocket/WebsocketConnectorRpcRemote.d.ts} +3 -3
  75. package/dist/src/connection/{WebSocket/WebSocketConnectorRpcRemote.js → websocket/WebsocketConnectorRpcRemote.js} +5 -10
  76. package/dist/src/connection/{WebSocket/WebSocketConnectorRpcRemote.js.map → websocket/WebsocketConnectorRpcRemote.js.map} +1 -1
  77. package/dist/src/connection/{WebSocket/WebSocketServer.d.ts → websocket/WebsocketServer.d.ts} +6 -3
  78. package/dist/src/connection/{WebSocket/WebSocketServer.js → websocket/WebsocketServer.js} +39 -19
  79. package/dist/src/connection/websocket/WebsocketServer.js.map +1 -0
  80. package/dist/src/dht/DhtNode.d.ts +11 -19
  81. package/dist/src/dht/DhtNode.js +119 -150
  82. package/dist/src/dht/DhtNode.js.map +1 -1
  83. package/dist/src/dht/DhtNodeRpcLocal.d.ts +22 -0
  84. package/dist/src/dht/DhtNodeRpcLocal.js +42 -0
  85. package/dist/src/dht/DhtNodeRpcLocal.js.map +1 -0
  86. package/dist/src/dht/{RemoteDhtNode.d.ts → DhtNodeRpcRemote.d.ts} +5 -3
  87. package/dist/src/dht/{RemoteDhtNode.js → DhtNodeRpcRemote.js} +17 -21
  88. package/dist/src/dht/DhtNodeRpcRemote.js.map +1 -0
  89. package/dist/src/dht/ExternalApiRpcLocal.d.ts +16 -0
  90. package/dist/src/dht/ExternalApiRpcLocal.js +30 -0
  91. package/dist/src/dht/ExternalApiRpcLocal.js.map +1 -0
  92. package/dist/src/dht/ExternalApiRpcRemote.d.ts +1 -1
  93. package/dist/src/dht/ExternalApiRpcRemote.js +2 -2
  94. package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -1
  95. package/dist/src/dht/contact/Remote.d.ts +4 -1
  96. package/dist/src/dht/contact/Remote.js +28 -2
  97. package/dist/src/dht/contact/Remote.js.map +1 -1
  98. package/dist/src/dht/contact/SortedContactList.d.ts +2 -2
  99. package/dist/src/dht/contact/SortedContactList.js +3 -3
  100. package/dist/src/dht/contact/SortedContactList.js.map +1 -1
  101. package/dist/src/dht/discovery/DiscoverySession.d.ts +9 -7
  102. package/dist/src/dht/discovery/DiscoverySession.js +8 -8
  103. package/dist/src/dht/discovery/DiscoverySession.js.map +1 -1
  104. package/dist/src/dht/discovery/PeerDiscovery.d.ts +7 -10
  105. package/dist/src/dht/discovery/PeerDiscovery.js +5 -5
  106. package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
  107. package/dist/src/dht/find/FindRpcLocal.d.ts +14 -0
  108. package/dist/src/dht/find/FindRpcLocal.js +25 -0
  109. package/dist/src/dht/find/FindRpcLocal.js.map +1 -0
  110. package/dist/src/dht/find/{RecursiveFindSession.d.ts → FindSession.d.ts} +12 -13
  111. package/dist/src/dht/find/{RecursiveFindSession.js → FindSession.js} +18 -15
  112. package/dist/src/dht/find/FindSession.js.map +1 -0
  113. package/dist/src/dht/find/FindSessionRpcLocal.d.ts +12 -0
  114. package/dist/src/dht/find/FindSessionRpcLocal.js +17 -0
  115. package/dist/src/dht/find/FindSessionRpcLocal.js.map +1 -0
  116. package/dist/src/dht/find/{RemoteRecursiveFindSession.d.ts → FindSessionRpcRemote.d.ts} +2 -2
  117. package/dist/src/dht/find/{RemoteRecursiveFindSession.js → FindSessionRpcRemote.js} +5 -5
  118. package/dist/src/dht/find/FindSessionRpcRemote.js.map +1 -0
  119. package/dist/src/dht/find/{RecursiveFinder.d.ts → Finder.d.ts} +16 -19
  120. package/dist/src/dht/find/{RecursiveFinder.js → Finder.js} +51 -46
  121. package/dist/src/dht/find/Finder.js.map +1 -0
  122. package/dist/src/dht/routing/FindRpcRemote.d.ts +6 -0
  123. package/dist/src/dht/routing/FindRpcRemote.js +41 -0
  124. package/dist/src/dht/routing/FindRpcRemote.js.map +1 -0
  125. package/dist/src/dht/routing/Router.d.ts +10 -17
  126. package/dist/src/dht/routing/Router.js +48 -90
  127. package/dist/src/dht/routing/Router.js.map +1 -1
  128. package/dist/src/dht/routing/RouterRpcLocal.d.ts +22 -0
  129. package/dist/src/dht/routing/RouterRpcLocal.js +66 -0
  130. package/dist/src/dht/routing/RouterRpcLocal.js.map +1 -0
  131. package/dist/src/dht/routing/RouterRpcRemote.d.ts +0 -1
  132. package/dist/src/dht/routing/RouterRpcRemote.js +15 -43
  133. package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -1
  134. package/dist/src/dht/routing/RoutingSession.d.ts +17 -8
  135. package/dist/src/dht/routing/RoutingSession.js +124 -131
  136. package/dist/src/dht/routing/RoutingSession.js.map +1 -1
  137. package/dist/src/dht/routing/getPreviousPeer.d.ts +2 -0
  138. package/dist/src/dht/routing/getPreviousPeer.js +9 -0
  139. package/dist/src/dht/routing/getPreviousPeer.js.map +1 -0
  140. package/dist/src/dht/store/StoreRpcLocal.d.ts +11 -8
  141. package/dist/src/dht/store/StoreRpcLocal.js +25 -24
  142. package/dist/src/dht/store/StoreRpcLocal.js.map +1 -1
  143. package/dist/src/dht/store/StoreRpcRemote.js +3 -7
  144. package/dist/src/dht/store/StoreRpcRemote.js.map +1 -1
  145. package/dist/src/exports.d.ts +11 -5
  146. package/dist/src/exports.js +17 -4
  147. package/dist/src/exports.js.map +1 -1
  148. package/dist/src/helpers/Connectivity.d.ts +4 -0
  149. package/dist/src/helpers/Connectivity.js +24 -0
  150. package/dist/src/helpers/Connectivity.js.map +1 -0
  151. package/dist/src/helpers/errors.d.ts +3 -3
  152. package/dist/src/helpers/errors.js +7 -7
  153. package/dist/src/helpers/protoClasses.js +3 -3
  154. package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +56 -39
  155. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +49 -36
  156. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
  157. package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +64 -84
  158. package/dist/src/proto/packages/dht/protos/DhtRpc.js +64 -66
  159. package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
  160. package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +26 -21
  161. package/dist/src/rpc-protocol/DhtCallContext.d.ts +0 -1
  162. package/dist/src/rpc-protocol/DhtCallContext.js.map +1 -1
  163. package/dist/src/transport/ITransport.d.ts +5 -6
  164. package/dist/src/transport/ListeningRpcCommunicator.d.ts +5 -1
  165. package/dist/src/transport/ListeningRpcCommunicator.js +8 -2
  166. package/dist/src/transport/ListeningRpcCommunicator.js.map +1 -1
  167. package/dist/src/transport/RoutingRpcCommunicator.d.ts +2 -1
  168. package/dist/src/transport/RoutingRpcCommunicator.js +0 -1
  169. package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
  170. package/dist/src/types/ServiceID.d.ts +1 -0
  171. package/dist/src/types/ServiceID.js +3 -0
  172. package/dist/src/types/ServiceID.js.map +1 -0
  173. package/karma.config.js +4 -4
  174. package/package.json +10 -8
  175. package/protos/DhtRpc.proto +32 -35
  176. package/src/connection/ConnectionLockHandler.ts +19 -17
  177. package/src/connection/ConnectionLockRpcLocal.ts +74 -0
  178. package/src/connection/ConnectionLockRpcRemote.ts +7 -6
  179. package/src/connection/ConnectionManager.ts +59 -95
  180. package/src/connection/ConnectivityChecker.ts +30 -26
  181. package/src/connection/ConnectorFacade.ts +74 -34
  182. package/src/connection/Handshaker.ts +9 -9
  183. package/src/connection/IConnection.ts +5 -6
  184. package/src/connection/ManagedConnection.ts +21 -22
  185. package/src/connection/{ManagedWebRtcConnection.ts → ManagedWebrtcConnection.ts} +9 -9
  186. package/src/connection/{Simulator → simulator}/Simulator.ts +4 -4
  187. package/src/connection/{Simulator → simulator}/SimulatorConnection.ts +23 -24
  188. package/src/connection/{Simulator → simulator}/SimulatorConnector.ts +13 -13
  189. package/src/connection/{Simulator → simulator}/SimulatorTransport.ts +2 -2
  190. package/src/connection/{WebRTC/BrowserWebRtcConnection.ts → webrtc/BrowserWebrtcConnection.ts} +12 -13
  191. package/src/connection/{WebRTC/IWebRtcConnection.ts → webrtc/IWebrtcConnection.ts} +2 -2
  192. package/src/connection/{WebRTC/NodeWebRtcConnection.ts → webrtc/NodeWebrtcConnection.ts} +32 -33
  193. package/src/connection/webrtc/WebrtcConnector.ts +225 -0
  194. package/src/connection/webrtc/WebrtcConnectorRpcLocal.ts +132 -0
  195. package/src/connection/{WebRTC/WebRtcConnectorRpcRemote.ts → webrtc/WebrtcConnectorRpcRemote.ts} +6 -7
  196. package/src/connection/{WebRTC → webrtc}/iceServerAsString.ts +1 -1
  197. package/src/connection/websocket/AutoCertifierClientFacade.ts +91 -0
  198. package/src/connection/{WebSocket/ClientWebSocket.ts → websocket/ClientWebsocket.ts} +19 -17
  199. package/src/connection/{WebSocket/ServerWebSocket.ts → websocket/ServerWebsocket.ts} +21 -27
  200. package/src/connection/{WebSocket/WebSocketConnectorRpcLocal.ts → websocket/WebsocketConnector.ts} +110 -101
  201. package/src/connection/websocket/WebsocketConnectorRpcLocal.ts +41 -0
  202. package/src/connection/{WebSocket/WebSocketConnectorRpcRemote.ts → websocket/WebsocketConnectorRpcRemote.ts} +6 -12
  203. package/src/connection/{WebSocket/WebSocketServer.ts → websocket/WebsocketServer.ts} +40 -22
  204. package/src/dht/DhtNode.ts +144 -179
  205. package/src/dht/DhtNodeRpcLocal.ts +68 -0
  206. package/src/dht/{RemoteDhtNode.ts → DhtNodeRpcRemote.ts} +12 -13
  207. package/src/dht/ExternalApiRpcLocal.ts +46 -0
  208. package/src/dht/ExternalApiRpcRemote.ts +4 -4
  209. package/src/dht/contact/Remote.ts +32 -4
  210. package/src/dht/contact/SortedContactList.ts +4 -4
  211. package/src/dht/discovery/DiscoverySession.ts +23 -20
  212. package/src/dht/discovery/PeerDiscovery.ts +14 -17
  213. package/src/dht/find/FindRpcLocal.ts +35 -0
  214. package/src/dht/find/{RecursiveFindSession.ts → FindSession.ts} +26 -25
  215. package/src/dht/find/FindSessionRpcLocal.ts +25 -0
  216. package/src/dht/find/{RemoteRecursiveFindSession.ts → FindSessionRpcRemote.ts} +9 -5
  217. package/src/dht/find/{RecursiveFinder.ts → Finder.ts} +78 -71
  218. package/src/dht/routing/FindRpcRemote.ts +40 -0
  219. package/src/dht/routing/Router.ts +70 -105
  220. package/src/dht/routing/RouterRpcLocal.ts +81 -0
  221. package/src/dht/routing/RouterRpcRemote.ts +15 -45
  222. package/src/dht/routing/RoutingSession.ts +56 -61
  223. package/src/dht/routing/getPreviousPeer.ts +6 -0
  224. package/src/dht/store/StoreRpcLocal.ts +44 -37
  225. package/src/dht/store/StoreRpcRemote.ts +4 -8
  226. package/src/exports.ts +11 -5
  227. package/src/helpers/Connectivity.ts +19 -0
  228. package/src/helpers/errors.ts +3 -3
  229. package/src/helpers/protoClasses.ts +6 -6
  230. package/src/proto/packages/dht/protos/DhtRpc.client.ts +75 -59
  231. package/src/proto/packages/dht/protos/DhtRpc.server.ts +26 -21
  232. package/src/proto/packages/dht/protos/DhtRpc.ts +87 -114
  233. package/src/rpc-protocol/DhtCallContext.ts +0 -1
  234. package/src/transport/ITransport.ts +5 -8
  235. package/src/transport/ListeningRpcCommunicator.ts +14 -4
  236. package/src/transport/RoutingRpcCommunicator.ts +3 -4
  237. package/src/types/ServiceID.ts +1 -0
  238. package/test/benchmark/{RecursiveFind.test.ts → Find.test.ts} +6 -6
  239. package/test/benchmark/KademliaCorrectness.test.ts +2 -2
  240. package/test/benchmark/kademlia-simulation/SimulationNode.ts +3 -3
  241. package/test/end-to-end/Layer0-Layer1.test.ts +13 -5
  242. package/test/end-to-end/Layer0.test.ts +35 -17
  243. package/test/end-to-end/Layer0MixedConnectionTypes.test.ts +24 -6
  244. package/test/end-to-end/{Layer0WebRTC-Layer1.test.ts → Layer0Webrtc-Layer1.test.ts} +1 -1
  245. package/test/end-to-end/{Layer0WebRTC.test.ts → Layer0Webrtc.test.ts} +14 -10
  246. package/test/end-to-end/Layer1-Scale-WebSocket.test.ts +8 -4
  247. package/test/end-to-end/{Layer1-Scale-WebRTC.test.ts → Layer1-Scale-Webrtc.test.ts} +2 -2
  248. package/test/end-to-end/RecoveryFromFailedAutoCertification.test.ts +52 -0
  249. package/test/end-to-end/{WebSocketConnectionRequest.test.ts → WebsocketConnectionRequest.test.ts} +16 -8
  250. package/test/end-to-end/memory-leak.test.ts +85 -0
  251. package/test/integration/ConnectionLocking.test.ts +4 -4
  252. package/test/integration/ConnectionManager.test.ts +37 -28
  253. package/test/integration/DhtJoinPeerDiscovery.test.ts +2 -2
  254. package/test/integration/DhtNodeExternalAPI.test.ts +10 -10
  255. package/test/integration/{RemoteDhtNode.test.ts → DhtNodeRpcRemote.test.ts} +10 -10
  256. package/test/integration/DhtRpc.test.ts +5 -5
  257. package/test/integration/{RecursiveFind.test.ts → Find.test.ts} +3 -3
  258. package/test/integration/Layer1-scale.test.ts +1 -1
  259. package/test/integration/MigrateData.test.ts +6 -5
  260. package/test/integration/Mock-Layer1-Layer0.test.ts +1 -1
  261. package/test/integration/MultipleEntryPointJoining.test.ts +6 -6
  262. package/test/integration/RouteMessage.test.ts +26 -26
  263. package/test/integration/RpcErrors.test.ts +10 -10
  264. package/test/integration/ScaleDownDht.test.ts +3 -3
  265. package/test/integration/SimultaneousConnections.test.ts +10 -7
  266. package/test/integration/Store.test.ts +1 -1
  267. package/test/integration/StoreAndDelete.test.ts +1 -1
  268. package/test/integration/StoreOnDhtWithTwoNodes.test.ts +12 -12
  269. package/test/integration/{WebRtcConnectionManagement.test.ts → WebrtcConnectionManagement.test.ts} +4 -4
  270. package/test/integration/{WebRtcConnectorRpc.test.ts → WebrtcConnectorRpc.test.ts} +7 -8
  271. package/test/integration/{WebSocket.test.ts → Websocket.test.ts} +14 -13
  272. package/test/integration/{WebSocketConnectionManagement.test.ts → WebsocketConnectionManagement.test.ts} +4 -4
  273. package/test/integration/{WebSocketConnectorRpc.test.ts → WebsocketConnectorRpc.test.ts} +15 -15
  274. package/test/unit/AutoCertifierClientFacade.test.ts +58 -0
  275. package/test/unit/ConnectivityHelpers.test.ts +69 -0
  276. package/test/unit/{RecursiveFinder.test.ts → Finder.test.ts} +19 -17
  277. package/test/unit/Router.test.ts +26 -26
  278. package/test/unit/UUID.test.ts +1 -1
  279. package/test/unit/{WebSocketConnectorRpcLocal.test.ts → WebsocketConnector.test.ts} +8 -8
  280. package/test/unit/{WebSocketServer.test.ts → WebsocketServer.test.ts} +20 -14
  281. package/test/unit/webrtcReplaceInternalIpWithExternalIp.test.ts +1 -1
  282. package/test/utils/FakeRpcCommunicator.ts +23 -0
  283. package/test/utils/mock/Transport.ts +1 -1
  284. package/test/utils/utils.ts +14 -24
  285. package/tsconfig.browser.json +1 -1
  286. package/tsconfig.jest.json +3 -2
  287. package/tsconfig.node.json +3 -2
  288. package/dist/src/connection/ManagedWebRtcConnection.d.ts +0 -7
  289. package/dist/src/connection/ManagedWebRtcConnection.js +0 -20
  290. package/dist/src/connection/ManagedWebRtcConnection.js.map +0 -1
  291. package/dist/src/connection/Simulator/SimulatorConnection.js.map +0 -1
  292. package/dist/src/connection/Simulator/SimulatorTransport.js.map +0 -1
  293. package/dist/src/connection/WebRTC/IWebRtcConnection.js.map +0 -1
  294. package/dist/src/connection/WebRTC/NodeWebRtcConnection.js.map +0 -1
  295. package/dist/src/connection/WebRTC/WebRtcConnectorRpcLocal.d.ts +0 -51
  296. package/dist/src/connection/WebRTC/WebRtcConnectorRpcLocal.js +0 -249
  297. package/dist/src/connection/WebRTC/WebRtcConnectorRpcLocal.js.map +0 -1
  298. package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.js.map +0 -1
  299. package/dist/src/connection/WebSocket/ClientWebSocket.js.map +0 -1
  300. package/dist/src/connection/WebSocket/ServerWebSocket.js.map +0 -1
  301. package/dist/src/connection/WebSocket/WebSocketConnectorRpcLocal.js.map +0 -1
  302. package/dist/src/connection/WebSocket/WebSocketServer.js.map +0 -1
  303. package/dist/src/dht/RemoteDhtNode.js.map +0 -1
  304. package/dist/src/dht/find/RecursiveFindSession.js.map +0 -1
  305. package/dist/src/dht/find/RecursiveFinder.js.map +0 -1
  306. package/dist/src/dht/find/RemoteRecursiveFindSession.js.map +0 -1
  307. package/dist/src/dht/registerExternalApiRpcMethods.d.ts +0 -2
  308. package/dist/src/dht/registerExternalApiRpcMethods.js +0 -32
  309. package/dist/src/dht/registerExternalApiRpcMethods.js.map +0 -1
  310. package/src/connection/WebRTC/WebRtcConnectorRpcLocal.ts +0 -335
  311. package/src/dht/registerExternalApiRpcMethods.ts +0 -44
  312. package/test/utils/mock/RecursiveFinder.ts +0 -19
  313. /package/dist/src/connection/{Simulator → simulator}/Simulator.d.ts +0 -0
  314. /package/dist/src/connection/{Simulator → simulator}/pings.d.ts +0 -0
  315. /package/dist/src/connection/{Simulator → simulator}/pings.js +0 -0
  316. /package/dist/src/connection/{WebRTC → webrtc}/iceServerAsString.js +0 -0
  317. /package/src/connection/{Simulator → simulator}/pings.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable max-len */
2
- import { WebSocketConnectorRpcLocal } from '../../src/connection/WebSocket/WebSocketConnectorRpcLocal'
2
+ import { WebsocketConnector } from '../../src/connection/websocket/WebsocketConnector'
3
3
  import { ConnectivityMethod, NodeType, PeerDescriptor } from '../../src/proto/packages/dht/protos/DhtRpc'
4
4
  import crypto from 'crypto'
5
5
  import { MockTransport } from '../utils/mock/Transport'
@@ -12,17 +12,17 @@ const createMockPeerDescriptor = (nodeType: NodeType, websocket?: ConnectivityMe
12
12
  }
13
13
  }
14
14
 
15
- describe('WebSocketConnectorRpcLocal', () => {
15
+ describe('WebsocketConnector', () => {
16
16
 
17
17
  describe('isPossibleToFormConnection', () => {
18
18
 
19
- const connector = new WebSocketConnectorRpcLocal({
19
+ const connector = new WebsocketConnector({
20
20
  transport: new MockTransport(),
21
21
  canConnect: () => {}
22
22
  } as any)
23
23
 
24
24
  it('node without server', () => {
25
- connector.setOwnPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS))
25
+ connector.setLocalPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS))
26
26
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: false }))).toBe(true)
27
27
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: true }))).toBe(true)
28
28
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS))).toBe(false)
@@ -30,7 +30,7 @@ describe('WebSocketConnectorRpcLocal', () => {
30
30
  })
31
31
 
32
32
  it('node with TLS server', () => {
33
- connector.setOwnPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '1.1.1.1', port: 11, tls: true }))
33
+ connector.setLocalPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '1.1.1.1', port: 11, tls: true }))
34
34
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: false }))).toBe(true)
35
35
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: true }))).toBe(true)
36
36
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS))).toBe(true)
@@ -38,7 +38,7 @@ describe('WebSocketConnectorRpcLocal', () => {
38
38
  })
39
39
 
40
40
  it('node with non-TLS server', () => {
41
- connector.setOwnPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '1.1.1.1', port: 11, tls: false }))
41
+ connector.setLocalPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '1.1.1.1', port: 11, tls: false }))
42
42
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: false }))).toBe(true)
43
43
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: true }))).toBe(true)
44
44
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS))).toBe(true)
@@ -46,7 +46,7 @@ describe('WebSocketConnectorRpcLocal', () => {
46
46
  })
47
47
 
48
48
  it('node with non-TLS server in local network', () => {
49
- connector.setOwnPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '192.168.11.11', port: 11, tls: false }))
49
+ connector.setLocalPeerDescriptor(createMockPeerDescriptor(NodeType.NODEJS, { host: '192.168.11.11', port: 11, tls: false }))
50
50
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: false }))).toBe(true)
51
51
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: true }))).toBe(true)
52
52
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS))).toBe(true)
@@ -54,7 +54,7 @@ describe('WebSocketConnectorRpcLocal', () => {
54
54
  })
55
55
 
56
56
  it('browser', () => {
57
- connector.setOwnPeerDescriptor(createMockPeerDescriptor(NodeType.BROWSER))
57
+ connector.setLocalPeerDescriptor(createMockPeerDescriptor(NodeType.BROWSER))
58
58
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: false }))).toBe(false)
59
59
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS, { host: '2.2.2.2', port: 22, tls: true }))).toBe(true)
60
60
  expect(connector.isPossibleToFormConnection(createMockPeerDescriptor(NodeType.NODEJS))).toBe(false)
@@ -1,10 +1,11 @@
1
- import { WebSocketServer } from '../../src/connection/WebSocket/WebSocketServer'
1
+ import { WebsocketServer } from '../../src/connection/websocket/WebsocketServer'
2
2
 
3
- describe('WebSocketServer', () => {
3
+ describe('WebsocketServer', () => {
4
4
 
5
5
  it('starts and stops', async () => {
6
- const server = new WebSocketServer({
7
- portRange: { min: 19792, max: 19792 }
6
+ const server = new WebsocketServer({
7
+ portRange: { min: 19792, max: 19792 },
8
+ enableTls: false
8
9
  })
9
10
  const port = await server.start()
10
11
  expect(port).toEqual(19792)
@@ -12,14 +13,16 @@ describe('WebSocketServer', () => {
12
13
  })
13
14
 
14
15
  it('throws if server is already in use', async () => {
15
- const server1 = new WebSocketServer({
16
- portRange: { min: 19792, max: 19792 }
16
+ const server1 = new WebsocketServer({
17
+ portRange: { min: 19792, max: 19792 },
18
+ enableTls: false
17
19
  })
18
20
  const port = await server1.start()
19
21
  expect(port).toEqual(19792)
20
22
 
21
- const server2 = new WebSocketServer({
22
- portRange: { min: 19792, max: 19792 }
23
+ const server2 = new WebsocketServer({
24
+ portRange: { min: 19792, max: 19792 },
25
+ enableTls: false
23
26
  })
24
27
  await expect(server2.start())
25
28
  .rejects
@@ -30,14 +33,16 @@ describe('WebSocketServer', () => {
30
33
  })
31
34
 
32
35
  it('Starts server in next port if first one is already in use', async () => {
33
- const server1 = new WebSocketServer({
34
- portRange: { min: 19792, max: 19793 }
36
+ const server1 = new WebsocketServer({
37
+ portRange: { min: 19792, max: 19793 },
38
+ enableTls: false
35
39
  })
36
40
  const port1 = await server1.start()
37
41
  expect(port1).toEqual(19792)
38
42
 
39
- const server2 = new WebSocketServer({
40
- portRange: { min: 19792, max: 19793 }
43
+ const server2 = new WebsocketServer({
44
+ portRange: { min: 19792, max: 19793 },
45
+ enableTls: false
41
46
  })
42
47
  const port2 = await server2.start()
43
48
  expect(port2).toEqual(19793)
@@ -47,8 +52,9 @@ describe('WebSocketServer', () => {
47
52
  })
48
53
 
49
54
  it('throws if too big a port number is given', async () => {
50
- const server = new WebSocketServer({
51
- portRange: { min: 197923233, max: 197923233 }
55
+ const server = new WebsocketServer({
56
+ portRange: { min: 197923233, max: 197923233 },
57
+ enableTls: false
52
58
  })
53
59
 
54
60
  await expect(server.start())
@@ -1,4 +1,4 @@
1
- import { replaceInternalIpWithExternalIp } from '../../src/connection/WebRTC/WebRtcConnectorRpcLocal'
1
+ import { replaceInternalIpWithExternalIp } from '../../src/connection/webrtc/WebrtcConnector'
2
2
 
3
3
  describe('replaceIpIfCandidateTypeIsHost', () => {
4
4
 
@@ -0,0 +1,23 @@
1
+ export class FakeRpcCommunicator {
2
+
3
+ private readonly listeners: Map<string, (...args: any[]) => Promise<unknown>> = new Map()
4
+
5
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
6
+ registerRpcMethod(_requestClass: any, _returnClass: any, methodName: string, callback: (...args: any[]) => Promise<unknown>): void {
7
+ this.listeners.set(methodName, callback)
8
+ }
9
+
10
+ async callRpcMethod(methodName: string, ...args: any[]): Promise<unknown> {
11
+ const listener = this.listeners.get(methodName)
12
+ if (listener !== undefined) {
13
+ return listener(...args)
14
+ } else {
15
+ throw new Error(`no registered callbacks for ${methodName}`)
16
+ }
17
+ }
18
+
19
+ // eslint-disable-next-line class-methods-use-this
20
+ getRpcClientTransport(): any {
21
+ return {}
22
+ }
23
+ }
@@ -10,7 +10,7 @@ export class MockTransport extends EventEmitter<TransportEvents> implements ITra
10
10
  }
11
11
 
12
12
  // eslint-disable-next-line class-methods-use-this
13
- getPeerDescriptor(): PeerDescriptor {
13
+ getLocalPeerDescriptor(): PeerDescriptor {
14
14
  return PeerDescriptor.create()
15
15
  }
16
16
 
@@ -11,27 +11,26 @@ import {
11
11
  RouteMessageWrapper,
12
12
  StoreDataRequest,
13
13
  StoreDataResponse,
14
- WebSocketConnectionResponse,
14
+ WebsocketConnectionResponse,
15
15
  FindRequest,
16
16
  DeleteDataResponse
17
17
  } from '../../src/proto/packages/dht/protos/DhtRpc'
18
18
  import { RpcMessage } from '../../src/proto/packages/proto-rpc/protos/ProtoRpc'
19
19
  import { PeerID } from '../../src/helpers/PeerID'
20
20
  import {
21
- IDhtRpcService,
21
+ IDhtNodeRpc,
22
22
  IRouterRpc,
23
23
  IStoreRpc,
24
- IWebSocketConnectorRpc
24
+ IWebsocketConnectorRpc
25
25
  } from '../../src/proto/packages/dht/protos/DhtRpc.server'
26
- import { Simulator } from '../../src/connection/Simulator/Simulator'
26
+ import { Simulator } from '../../src/connection/simulator/Simulator'
27
27
  import { ConnectionManager } from '../../src/connection/ConnectionManager'
28
28
  import { v4 } from 'uuid'
29
- import { getRandomRegion } from '../../src/connection/Simulator/pings'
29
+ import { getRandomRegion } from '../../src/connection/simulator/pings'
30
30
  import { Empty } from '../../src/proto/google/protobuf/empty'
31
31
  import { Any } from '../../src/proto/google/protobuf/any'
32
32
  import { wait, waitForCondition } from '@streamr/utils'
33
- import { RoutingRpcCommunicator } from '../../src/transport/RoutingRpcCommunicator'
34
- import { SimulatorTransport } from '../../src/connection/Simulator/SimulatorTransport'
33
+ import { SimulatorTransport } from '../../src/connection/simulator/SimulatorTransport'
35
34
 
36
35
  export const generateId = (stringId: string): Uint8Array => {
37
36
  return PeerID.fromString(stringId).value
@@ -63,7 +62,8 @@ export const createMockConnectionDhtNode = async (
63
62
  transport: mockConnectionManager,
64
63
  numberOfNodesPerKBucket,
65
64
  maxConnections: maxConnections,
66
- dhtJoinTimeout
65
+ dhtJoinTimeout,
66
+ rpcRequestTimeout: 5000
67
67
  })
68
68
  await node.start()
69
69
  return node
@@ -82,7 +82,8 @@ export const createMockConnectionLayer1Node = async (
82
82
  }
83
83
  const node = new DhtNode({
84
84
  peerDescriptor: descriptor, transport: layer0Node,
85
- serviceId: serviceId ? serviceId : 'layer1', numberOfNodesPerKBucket
85
+ serviceId: serviceId ? serviceId : 'layer1', numberOfNodesPerKBucket,
86
+ rpcRequestTimeout: 10000
86
87
  })
87
88
  await node.start()
88
89
  return node
@@ -117,7 +118,7 @@ export const createFindRequest = (
117
118
  return request
118
119
  }
119
120
 
120
- interface IDhtRpcWithError extends IDhtRpcService {
121
+ interface IDhtRpcWithError extends IDhtNodeRpc {
121
122
  throwPingError: (request: PingRequest) => Promise<PingResponse>
122
123
  respondPingWithTimeout: (request: PingRequest) => Promise<PingResponse>
123
124
  throwGetClosestPeersError: (request: ClosestPeersRequest) => Promise<ClosestPeersResponse>
@@ -168,13 +169,6 @@ export const mockRouterRpc: IRouterRpcWithError = {
168
169
  }
169
170
  return response
170
171
  },
171
- async findRecursively(routed: RouteMessageWrapper): Promise<RouteMessageAck> {
172
- const response: RouteMessageAck = {
173
- requestId: routed.requestId,
174
- error: ''
175
- }
176
- return response
177
- },
178
172
  async forwardMessage(routed: RouteMessageWrapper): Promise<RouteMessageAck> {
179
173
  const response: RouteMessageAck = {
180
174
  requestId: routed.requestId,
@@ -214,9 +208,9 @@ export const mockStoreRpc: IStoreRpcWithError = {
214
208
  }
215
209
  }
216
210
 
217
- export const mockWebSocketConnectorRpc: IWebSocketConnectorRpc = {
218
- async requestConnection(): Promise<WebSocketConnectionResponse> {
219
- const responseConnection: WebSocketConnectionResponse = {
211
+ export const mockWebsocketConnectorRpc: IWebsocketConnectorRpc = {
212
+ async requestConnection(): Promise<WebsocketConnectionResponse> {
213
+ const responseConnection: WebsocketConnectionResponse = {
220
214
  accepted: true
221
215
  }
222
216
  return responseConnection
@@ -284,7 +278,3 @@ async function waitReadyForTesting(connectionManager: ConnectionManager, limit:
284
278
  }
285
279
  }
286
280
  }
287
-
288
- export function createMockRoutingRpcCommunicator(): RoutingRpcCommunicator {
289
- return new RoutingRpcCommunicator('router', async (_msg, _doNotConnect) => {})
290
- }
@@ -10,6 +10,6 @@
10
10
  "test/**/*"
11
11
  ],
12
12
  "exclude": [
13
- "src/connection/WebRTC/NodeWebRtcConnection.ts"
13
+ "src/connection/webrtc/NodeWebrtcConnection.ts"
14
14
  ]
15
15
  }
@@ -9,11 +9,12 @@
9
9
  "test/**/*"
10
10
  ],
11
11
  "exclude": [
12
- "src/connection/WebRTC/BrowserWebRtcConnection.ts"
12
+ "src/connection/webrtc/BrowserWebrtcConnection.ts"
13
13
  ],
14
14
  "references": [
15
15
  { "path": "../utils/tsconfig.node.json" },
16
16
  { "path": "../test-utils/tsconfig.node.json" },
17
- { "path": "../proto-rpc/tsconfig.node.json" }
17
+ { "path": "../proto-rpc/tsconfig.node.json" },
18
+ { "path": "../autocertifier-client/tsconfig.node.json" }
18
19
  ]
19
20
  }
@@ -8,11 +8,12 @@
8
8
  "src/**/*"
9
9
  ],
10
10
  "exclude": [
11
- "src/connection/WebRTC/BrowserWebRtcConnection.ts"
11
+ "src/connection/webrtc/BrowserWebrtcConnection.ts"
12
12
  ],
13
13
  "references": [
14
14
  { "path": "../utils/tsconfig.node.json" },
15
15
  { "path": "../test-utils/tsconfig.node.json" },
16
- { "path": "../proto-rpc/tsconfig.node.json" }
16
+ { "path": "../proto-rpc/tsconfig.node.json" },
17
+ { "path": "../autocertifier-client/tsconfig.node.json" }
17
18
  ]
18
19
  }
@@ -1,7 +0,0 @@
1
- import { PeerDescriptor } from '../proto/packages/dht/protos/DhtRpc';
2
- import { ManagedConnection } from './ManagedConnection';
3
- import { NodeWebRtcConnection } from './WebRTC/NodeWebRtcConnection';
4
- export declare class ManagedWebRtcConnection extends ManagedConnection {
5
- constructor(ownPeerDescriptor: PeerDescriptor, connectingConnection?: NodeWebRtcConnection, connectedConnection?: NodeWebRtcConnection);
6
- getWebRtcConnection(): NodeWebRtcConnection;
7
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManagedWebRtcConnection = void 0;
4
- const IConnection_1 = require("./IConnection");
5
- const ManagedConnection_1 = require("./ManagedConnection");
6
- class ManagedWebRtcConnection extends ManagedConnection_1.ManagedConnection {
7
- constructor(ownPeerDescriptor, connectingConnection, connectedConnection) {
8
- super(ownPeerDescriptor, IConnection_1.ConnectionType.WEBRTC, connectingConnection, connectedConnection);
9
- }
10
- getWebRtcConnection() {
11
- if (this.outgoingConnection) {
12
- return this.outgoingConnection;
13
- }
14
- else {
15
- return this.incomingConnection;
16
- }
17
- }
18
- }
19
- exports.ManagedWebRtcConnection = ManagedWebRtcConnection;
20
- //# sourceMappingURL=ManagedWebRtcConnection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManagedWebRtcConnection.js","sourceRoot":"","sources":["../../../src/connection/ManagedWebRtcConnection.ts"],"names":[],"mappings":";;;AACA,+CAA8C;AAC9C,2DAAuD;AAGvD,MAAa,uBAAwB,SAAQ,qCAAiB;IAE1D,YAAY,iBAAiC,EACzC,oBAA2C,EAC3C,mBAA0C;QAC1C,KAAK,CACD,iBAAiB,EACjB,4BAAc,CAAC,MAAM,EACrB,oBAAoB,EACpB,mBAAmB,CAAC,CAAA;IAC5B,CAAC;IAEM,mBAAmB;QACtB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YACzB,OAAO,IAAI,CAAC,kBAAqD,CAAA;SACpE;aAAM;YACH,OAAO,IAAI,CAAC,kBAAqD,CAAA;SACpE;IACL,CAAC;CACJ;AAnBD,0DAmBC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimulatorConnection.js","sourceRoot":"","sources":["../../../../src/connection/Simulator/SimulatorConnection.ts"],"names":[],"mappings":";;;AAEA,mEAAgF;AAChF,8CAA0C;AAC1C,0CAAuC;AACvC,+DAA2D;AAE3D,qFAA8E;AAE9E,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,mBAAoB,SAAQ,uBAAU;IAO/C,YACI,iBAAiC,EACjC,oBAAoC,EACpC,cAA8B,EAC9B,SAAoB;QAEpB,KAAK,CAAC,cAAc,CAAC,CAAA;QAXjB,YAAO,GAAG,KAAK,CAAA;QAanB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAA;QAC5C,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAA;QAChD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAE1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC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,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;SACzC;aAAM;YACH,MAAM,CAAC,KAAK,CAAC,IAAA,gDAAqB,EAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,+CAA+C,CAAC,CAAA;SAChH;IACL,CAAC;IAEO,YAAY,CAAC,iBAAoC;QACrD,MAAM,CAAC,KAAK,CAAC,IAAA,gDAAqB,EAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,CAAA;QAC/E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QAEnB,MAAM,CAAC,KAAK,CAAC,IAAA,gDAAqB,EAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,IAAI;cAC3D,IAAA,gDAAqB,EAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,wBAAwB,CAAC,CAAA;QAElF,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;IAEhD,CAAC;CACJ;AAhID,kDAgIC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimulatorTransport.js","sourceRoot":"","sources":["../../../../src/connection/Simulator/SimulatorTransport.ts"],"names":[],"mappings":";;;AAAA,0CAA+C;AAE/C,4DAAwD;AAExD,wDAA6D;AAE7D,MAAa,kBAAmB,SAAQ,qCAAiB;IACrD,YAAY,iBAAiC,EAAE,SAAoB;QAC/D,KAAK,CAAC;YACF,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,0CAAwB,CAAC,iBAAiB,EAAE,SAAS,CAAC;YACvF,cAAc,EAAE,IAAI,sBAAc,EAAE;SACvC,CAAC,CAAA;IACN,CAAC;CACJ;AAPD,gDAOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IWebRtcConnection.js","sourceRoot":"","sources":["../../../../src/connection/WebRTC/IWebRtcConnection.ts"],"names":[],"mappings":";;;AAKA,IAAY,cAGX;AAHD,WAAY,c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C/F,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAC1B,CAAC;IAEO,aAAa,CAAC,KAAa;QAC/B,MAAM,CAAC,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAA;QACtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACnF,MAAM,IAAI,sCAA6B,CAAC,8CAA8C,GAAG,KAAK,CAAC,CAAA;SAClG;aAAM;YACH,IAAI,CAAC,SAAS,GAAG,KAA+B,CAAA;SACnD;QAED,IAAI,KAAK,KAAK,0BAA0B,CAAC,MAAM;eACxC,KAAK,KAAK,0BAA0B,CAAC,YAAY;eACjD,KAAK,KAAK,0BAA0B,CAAC,MAAM,EAChD;YACE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;SACxB;IAEL,CAAC;IAED,MAAM;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,KAAK,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAA;IAC/E,CAAC;IAEM,eAAe,CAAC,YAAoB;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,0BAAY,CAAC,YAAY,CAAC,CAAA;IACtD,CAAC;CACJ;AArND,oDAqNC"}
@@ -1,51 +0,0 @@
1
- import { IceCandidate, PeerDescriptor, RtcAnswer, RtcOffer, WebRtcConnectionRequest } from '../../proto/packages/dht/protos/DhtRpc';
2
- import { Empty } from '../../proto/google/protobuf/empty';
3
- import { ITransport } from '../../transport/ITransport';
4
- import { IWebRtcConnectorRpc } from '../../proto/packages/dht/protos/DhtRpc.server';
5
- import { ManagedConnection } from '../ManagedConnection';
6
- import { PortRange } from '../ConnectionManager';
7
- import { ServerCallContext } from '@protobuf-ts/runtime-rpc';
8
- export declare const replaceInternalIpWithExternalIp: (candidate: string, ip: string) => string;
9
- export interface WebRtcConnectorRpcLocalConfig {
10
- transport: ITransport;
11
- iceServers?: IceServer[];
12
- allowPrivateAddresses?: boolean;
13
- bufferThresholdLow?: number;
14
- bufferThresholdHigh?: number;
15
- maxMessageSize?: number;
16
- connectionTimeout?: number;
17
- externalIp?: string;
18
- portRange?: PortRange;
19
- }
20
- export interface IceServer {
21
- url: string;
22
- port: number;
23
- username?: string;
24
- password?: string;
25
- tcp?: boolean;
26
- }
27
- export declare class WebRtcConnectorRpcLocal implements IWebRtcConnectorRpc {
28
- private static readonly WEBRTC_CONNECTOR_SERVICE_ID;
29
- private readonly rpcCommunicator;
30
- private readonly ongoingConnectAttempts;
31
- private ownPeerDescriptor?;
32
- private stopped;
33
- private iceServers;
34
- private allowPrivateAddresses;
35
- private config;
36
- private onIncomingConnection;
37
- constructor(config: WebRtcConnectorRpcLocalConfig, onIncomingConnection: (connection: ManagedConnection) => boolean);
38
- connect(targetPeerDescriptor: PeerDescriptor): ManagedConnection;
39
- setOwnPeerDescriptor(peerDescriptor: PeerDescriptor): void;
40
- private isIceCandidateAllowed;
41
- private onRtcOffer;
42
- private onRtcAnswer;
43
- private onConnectionRequest;
44
- private onRemoteCandidate;
45
- stop(): Promise<void>;
46
- isOffering(targetPeerDescriptor: PeerDescriptor): boolean;
47
- requestConnection(_request: WebRtcConnectionRequest, context: ServerCallContext): Promise<Empty>;
48
- rtcOffer(request: RtcOffer, context: ServerCallContext): Promise<Empty>;
49
- rtcAnswer(request: RtcAnswer, context: ServerCallContext): Promise<Empty>;
50
- iceCandidate(request: IceCandidate, context: ServerCallContext): Promise<Empty>;
51
- }