@streamr/dht 100.0.0-testnet-one.4 → 100.0.0-testnet-two.1
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/dist/package.json +66 -0
- package/dist/src/connection/ConnectionLockHandler.d.ts +11 -11
- package/dist/src/connection/ConnectionLockHandler.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcLocal.d.ts +3 -3
- package/dist/src/connection/ConnectionLockRpcLocal.js +4 -4
- package/dist/src/connection/ConnectionLockRpcLocal.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcRemote.d.ts +3 -5
- package/dist/src/connection/ConnectionLockRpcRemote.js +4 -7
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -1
- package/dist/src/connection/ConnectionManager.d.ts +4 -6
- package/dist/src/connection/ConnectionManager.js +48 -46
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +2 -2
- package/dist/src/connection/ConnectorFacade.js +2 -1
- package/dist/src/connection/ConnectorFacade.js.map +1 -1
- package/dist/src/connection/Handshaker.d.ts +1 -1
- package/dist/src/connection/Handshaker.js +14 -5
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +4 -7
- package/dist/src/connection/ManagedConnection.js +9 -13
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/connectivityChecker.js +1 -0
- package/dist/src/connection/connectivityChecker.js.map +1 -1
- package/dist/src/connection/simulator/Simulator.d.ts +0 -3
- package/dist/src/connection/simulator/Simulator.js +3 -51
- package/dist/src/connection/simulator/Simulator.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnector.js +5 -5
- package/dist/src/connection/simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js +2 -2
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnector.d.ts +0 -1
- package/dist/src/connection/webrtc/WebrtcConnector.js +7 -9
- package/dist/src/connection/webrtc/WebrtcConnector.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.d.ts +2 -2
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js +21 -14
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.d.ts +2 -5
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.js +1 -4
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/AutoCertifierClientFacade.d.ts +1 -2
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js +3 -4
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js.map +1 -1
- package/dist/src/connection/websocket/ClientWebsocket.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnector.d.ts +2 -7
- package/dist/src/connection/websocket/WebsocketConnector.js +48 -44
- package/dist/src/connection/websocket/WebsocketConnector.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.d.ts +3 -2
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js +8 -10
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.d.ts +3 -6
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js +0 -3
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketServer.d.ts +1 -4
- package/dist/src/connection/websocket/WebsocketServer.js +11 -12
- package/dist/src/connection/websocket/WebsocketServer.js.map +1 -1
- package/dist/src/dht/DhtNode.d.ts +10 -13
- package/dist/src/dht/DhtNode.js +41 -54
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.d.ts +2 -3
- package/dist/src/dht/DhtNodeRpcLocal.js +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcRemote.d.ts +7 -7
- package/dist/src/dht/DhtNodeRpcRemote.js +9 -11
- package/dist/src/dht/DhtNodeRpcRemote.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcLocal.d.ts +5 -4
- package/dist/src/dht/ExternalApiRpcLocal.js +3 -2
- package/dist/src/dht/ExternalApiRpcLocal.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcRemote.d.ts +2 -2
- package/dist/src/dht/ExternalApiRpcRemote.js +2 -0
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -1
- package/dist/src/dht/PeerManager.d.ts +13 -14
- package/dist/src/dht/PeerManager.js +45 -60
- package/dist/src/dht/PeerManager.js.map +1 -1
- package/dist/src/dht/contact/Contact.d.ts +2 -2
- package/dist/src/dht/contact/Contact.js +2 -2
- package/dist/src/dht/contact/Contact.js.map +1 -1
- package/dist/src/dht/contact/ContactList.d.ts +7 -7
- package/dist/src/dht/contact/ContactList.js +3 -3
- package/dist/src/dht/contact/ContactList.js.map +1 -1
- package/dist/src/dht/contact/RandomContactList.d.ts +4 -4
- package/dist/src/dht/contact/RandomContactList.js +12 -11
- package/dist/src/dht/contact/RandomContactList.js.map +1 -1
- package/dist/src/dht/contact/RpcRemote.d.ts +7 -4
- package/dist/src/dht/contact/RpcRemote.js +5 -2
- package/dist/src/dht/contact/RpcRemote.js.map +1 -1
- package/dist/src/dht/contact/SortedContactList.d.ts +13 -13
- package/dist/src/dht/contact/SortedContactList.js +33 -29
- package/dist/src/dht/contact/SortedContactList.js.map +1 -1
- package/dist/src/dht/discovery/DiscoverySession.d.ts +2 -4
- package/dist/src/dht/discovery/DiscoverySession.js +19 -23
- package/dist/src/dht/discovery/DiscoverySession.js.map +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +2 -5
- package/dist/src/dht/discovery/PeerDiscovery.js +12 -20
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.d.ts +36 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js +165 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.d.ts +14 -0
- package/dist/src/dht/{find/FindRpcLocal.js → recursive-operation/RecursiveOperationRpcLocal.js} +7 -7
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.d.ts +6 -0
- package/dist/src/dht/{routing/FindRpcRemote.js → recursive-operation/RecursiveOperationRpcRemote.js} +11 -11
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.d.ts +42 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js +182 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.d.ts +12 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js +17 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.d.ts +6 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.js +21 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.js.map +1 -0
- package/dist/src/dht/routing/Router.d.ts +4 -19
- package/dist/src/dht/routing/Router.js +41 -33
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcLocal.js +6 -5
- package/dist/src/dht/routing/RouterRpcLocal.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcRemote.d.ts +2 -2
- package/dist/src/dht/routing/RouterRpcRemote.js +7 -7
- package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -1
- package/dist/src/dht/routing/RoutingSession.d.ts +20 -16
- package/dist/src/dht/routing/RoutingSession.js +37 -45
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/store/LocalDataStore.d.ts +11 -13
- package/dist/src/dht/store/LocalDataStore.js +36 -56
- package/dist/src/dht/store/LocalDataStore.js.map +1 -1
- package/dist/src/dht/store/StoreManager.d.ts +33 -0
- package/dist/src/dht/store/StoreManager.js +186 -0
- package/dist/src/dht/store/StoreManager.js.map +1 -0
- package/dist/src/dht/store/StoreRpcLocal.d.ts +8 -40
- package/dist/src/dht/store/StoreRpcLocal.js +13 -229
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -1
- package/dist/src/dht/store/StoreRpcRemote.d.ts +5 -5
- package/dist/src/dht/store/StoreRpcRemote.js +4 -5
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -1
- package/dist/src/exports.d.ts +2 -0
- package/dist/src/exports.js.map +1 -1
- package/dist/src/helpers/MapWithTtl.d.ts +14 -0
- package/dist/src/helpers/MapWithTtl.js +59 -0
- package/dist/src/helpers/MapWithTtl.js.map +1 -0
- package/dist/src/helpers/PeerID.d.ts +2 -0
- package/dist/src/helpers/PeerID.js +4 -0
- package/dist/src/helpers/PeerID.js.map +1 -1
- package/dist/src/helpers/nodeId.d.ts +5 -0
- package/dist/src/helpers/nodeId.js +18 -1
- package/dist/src/helpers/nodeId.js.map +1 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.d.ts +2 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.js +2 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.js.map +1 -1
- package/dist/src/helpers/protoClasses.js +2 -3
- package/dist/src/helpers/protoClasses.js.map +1 -1
- package/dist/src/helpers/versionCompatibility.d.ts +2 -0
- package/dist/src/helpers/versionCompatibility.js +18 -0
- package/dist/src/helpers/versionCompatibility.js.map +1 -0
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +21 -22
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +18 -18
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +49 -65
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +43 -58
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +11 -12
- package/dist/src/rpc-protocol/DhtCallContext.d.ts +2 -1
- package/dist/src/rpc-protocol/DhtCallContext.js.map +1 -1
- package/dist/src/rpc-protocol/DhtRpcOptions.d.ts +2 -1
- package/dist/src/transport/ITransport.d.ts +9 -1
- package/dist/src/transport/ITransport.js +5 -0
- package/dist/src/transport/ITransport.js.map +1 -1
- package/dist/src/transport/ListeningRpcCommunicator.js +1 -1
- package/dist/src/transport/ListeningRpcCommunicator.js.map +1 -1
- package/dist/src/transport/RoutingRpcCommunicator.d.ts +2 -1
- package/dist/src/transport/RoutingRpcCommunicator.js +16 -11
- package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
- package/jest.config.js +4 -1
- package/karma-setup.js +2 -0
- package/karma.config.js +11 -7
- package/package.json +6 -7
- package/protos/DhtRpc.proto +20 -24
- package/src/connection/ConnectionLockHandler.ts +15 -15
- package/src/connection/ConnectionLockRpcLocal.ts +8 -9
- package/src/connection/ConnectionLockRpcRemote.ts +7 -16
- package/src/connection/ConnectionManager.ts +58 -55
- package/src/connection/ConnectorFacade.ts +3 -0
- package/src/connection/Handshaker.ts +21 -6
- package/src/connection/ManagedConnection.ts +20 -34
- package/src/connection/connectivityChecker.ts +1 -0
- package/src/connection/simulator/Simulator.ts +5 -36
- package/src/connection/simulator/SimulatorConnector.ts +8 -8
- package/src/connection/webrtc/BrowserWebrtcConnection.ts +0 -3
- package/src/connection/webrtc/NodeWebrtcConnection.ts +3 -4
- package/src/connection/webrtc/WebrtcConnector.ts +11 -13
- package/src/connection/webrtc/WebrtcConnectorRpcLocal.ts +25 -18
- package/src/connection/webrtc/WebrtcConnectorRpcRemote.ts +3 -13
- package/src/connection/websocket/AutoCertifierClientFacade.ts +4 -6
- package/src/connection/websocket/ClientWebsocket.ts +1 -0
- package/src/connection/websocket/WebsocketConnector.ts +57 -61
- package/src/connection/websocket/WebsocketConnectorRpcLocal.ts +11 -13
- package/src/connection/websocket/WebsocketConnectorRpcRemote.ts +4 -15
- package/src/connection/websocket/WebsocketServer.ts +14 -17
- package/src/dht/DhtNode.ts +69 -71
- package/src/dht/DhtNodeRpcLocal.ts +1 -3
- package/src/dht/DhtNodeRpcRemote.ts +14 -18
- package/src/dht/ExternalApiRpcLocal.ts +16 -6
- package/src/dht/ExternalApiRpcRemote.ts +5 -3
- package/src/dht/PeerManager.ts +73 -90
- package/src/dht/contact/Contact.ts +5 -4
- package/src/dht/contact/ContactList.ts +9 -9
- package/src/dht/contact/RandomContactList.ts +14 -14
- package/src/dht/contact/RpcRemote.ts +10 -7
- package/src/dht/contact/SortedContactList.ts +48 -45
- package/src/dht/discovery/DiscoverySession.ts +25 -27
- package/src/dht/discovery/PeerDiscovery.ts +16 -37
- package/src/dht/recursive-operation/RecursiveOperationManager.ts +240 -0
- package/src/dht/{find/FindRpcLocal.ts → recursive-operation/RecursiveOperationRpcLocal.ts} +9 -9
- package/src/dht/{routing/FindRpcRemote.ts → recursive-operation/RecursiveOperationRpcRemote.ts} +10 -10
- package/src/dht/recursive-operation/RecursiveOperationSession.ts +224 -0
- package/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.ts +25 -0
- package/src/dht/{find/FindSessionRpcRemote.ts → recursive-operation/RecursiveOperationSessionRpcRemote.ts} +8 -8
- package/src/dht/routing/Router.ts +45 -64
- package/src/dht/routing/RouterRpcLocal.ts +7 -6
- package/src/dht/routing/RouterRpcRemote.ts +9 -10
- package/src/dht/routing/RoutingSession.ts +59 -68
- package/src/dht/store/LocalDataStore.ts +47 -66
- package/src/dht/store/StoreManager.ts +217 -0
- package/src/dht/store/StoreRpcLocal.ts +26 -302
- package/src/dht/store/StoreRpcRemote.ts +9 -11
- package/src/exports.ts +2 -0
- package/src/helpers/MapWithTtl.ts +71 -0
- package/src/helpers/PeerID.ts +5 -0
- package/src/helpers/nodeId.ts +20 -0
- package/src/helpers/peerIdFromPeerDescriptor.ts +5 -3
- package/src/helpers/protoClasses.ts +4 -6
- package/src/helpers/versionCompatibility.ts +13 -0
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +31 -32
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +11 -12
- package/src/proto/packages/dht/protos/DhtRpc.ts +67 -90
- package/src/rpc-protocol/DhtCallContext.ts +2 -1
- package/src/rpc-protocol/DhtRpcOptions.ts +2 -1
- package/src/transport/ITransport.ts +10 -1
- package/src/transport/ListeningRpcCommunicator.ts +1 -1
- package/src/transport/RoutingRpcCommunicator.ts +18 -12
- package/test/benchmark/Find.test.ts +8 -21
- package/test/benchmark/KademliaCorrectness.test.ts +11 -20
- package/test/benchmark/SortedContactListBenchmark.test.ts +9 -9
- package/test/benchmark/kademlia-simulation/Contact.ts +9 -8
- package/test/benchmark/kademlia-simulation/KademliaSimulation.ts +2 -2
- package/test/benchmark/kademlia-simulation/SimulationNode.ts +17 -17
- package/test/end-to-end/Layer0-Layer1.test.ts +10 -14
- package/test/end-to-end/Layer0.test.ts +15 -18
- package/test/end-to-end/Layer0MixedConnectionTypes.test.ts +7 -9
- package/test/end-to-end/Layer0Webrtc-Layer1.test.ts +4 -10
- package/test/end-to-end/Layer0Webrtc.test.ts +5 -6
- package/test/end-to-end/Layer1-Scale-WebSocket.test.ts +8 -16
- package/test/end-to-end/Layer1-Scale-Webrtc.test.ts +6 -13
- package/test/end-to-end/WebsocketConnectionRequest.test.ts +5 -6
- package/test/end-to-end/memory-leak.test.ts +6 -8
- package/test/integration/ConnectionLocking.test.ts +6 -13
- package/test/integration/ConnectionManager.test.ts +26 -43
- package/test/integration/DhtJoinPeerDiscovery.test.ts +5 -10
- package/test/integration/DhtNodeExternalAPI.test.ts +16 -22
- package/test/integration/DhtNodeRpcRemote.test.ts +13 -22
- package/test/integration/DhtRpc.test.ts +13 -18
- package/test/integration/Find.test.ts +10 -10
- package/test/integration/Layer1-scale.test.ts +17 -28
- package/test/integration/Mock-Layer1-Layer0.test.ts +25 -43
- package/test/integration/MultipleEntryPointJoining.test.ts +7 -7
- package/test/integration/ReplicateData.test.ts +28 -30
- package/test/integration/RouteMessage.test.ts +30 -27
- package/test/integration/RouterRpcRemote.test.ts +12 -18
- package/test/integration/RpcErrors.test.ts +8 -21
- package/test/integration/ScaleDownDht.test.ts +11 -10
- package/test/integration/SimultaneousConnections.test.ts +43 -67
- package/test/integration/Store.test.ts +23 -36
- package/test/integration/StoreAndDelete.test.ts +30 -50
- package/test/integration/StoreOnDhtWithTwoNodes.test.ts +16 -37
- package/test/integration/StoreRpcRemote.test.ts +20 -30
- package/test/integration/WebrtcConnectionManagement.test.ts +3 -13
- package/test/integration/WebrtcConnectorRpc.test.ts +3 -9
- package/test/integration/WebsocketConnectionManagement.test.ts +7 -10
- package/test/integration/WebsocketConnectorRpc.test.ts +8 -17
- package/test/unit/ConnectivityHelpers.test.ts +9 -17
- package/test/unit/DuplicateDetector.test.ts +7 -4
- package/test/unit/LocalDataStore.test.ts +66 -77
- package/test/unit/PeerManager.test.ts +31 -0
- package/test/unit/RandomContactList.test.ts +13 -8
- package/test/unit/{Finder.test.ts → RecursiveOperationManager.test.ts} +38 -43
- package/test/unit/RecursiveOperationSession.test.ts +68 -0
- package/test/unit/Router.test.ts +15 -22
- package/test/unit/RoutingSession.test.ts +23 -25
- package/test/unit/SortedContactList.test.ts +41 -26
- package/test/unit/StoreManager.test.ts +132 -0
- package/test/unit/WebsocketConnector.test.ts +27 -35
- package/test/unit/customMatchers.test.ts +16 -0
- package/test/unit/versionCompatibility.test.ts +16 -0
- package/test/utils/FakeTransport.ts +44 -0
- package/test/utils/customMatchers.ts +70 -0
- package/test/utils/mock/MockRpcCommunicator.ts +7 -0
- package/test/utils/mock/Router.ts +3 -2
- package/test/utils/mock/mockDataEntry.ts +36 -0
- package/test/utils/utils.ts +49 -87
- package/tsconfig.browser.json +2 -1
- package/tsconfig.jest.json +2 -1
- package/tsconfig.node.json +2 -1
- package/dist/src/dht/find/FindRpcLocal.d.ts +0 -14
- package/dist/src/dht/find/FindRpcLocal.js.map +0 -1
- package/dist/src/dht/find/FindSession.d.ts +0 -44
- package/dist/src/dht/find/FindSession.js +0 -150
- package/dist/src/dht/find/FindSession.js.map +0 -1
- package/dist/src/dht/find/FindSessionRpcLocal.d.ts +0 -12
- package/dist/src/dht/find/FindSessionRpcLocal.js +0 -17
- package/dist/src/dht/find/FindSessionRpcLocal.js.map +0 -1
- package/dist/src/dht/find/FindSessionRpcRemote.d.ts +0 -6
- package/dist/src/dht/find/FindSessionRpcRemote.js +0 -21
- package/dist/src/dht/find/FindSessionRpcRemote.js.map +0 -1
- package/dist/src/dht/find/Finder.d.ts +0 -49
- package/dist/src/dht/find/Finder.js +0 -197
- package/dist/src/dht/find/Finder.js.map +0 -1
- package/dist/src/dht/routing/FindRpcRemote.d.ts +0 -6
- package/dist/src/dht/routing/FindRpcRemote.js.map +0 -1
- package/src/dht/find/FindSession.ts +0 -183
- package/src/dht/find/FindSessionRpcLocal.ts +0 -25
- package/src/dht/find/Finder.ts +0 -295
|
@@ -32,7 +32,6 @@ const DhtRpc_client_1 = require("../../proto/packages/dht/protos/DhtRpc.client")
|
|
|
32
32
|
const ManagedWebrtcConnection_1 = require("../ManagedWebrtcConnection");
|
|
33
33
|
const utils_1 = require("@streamr/utils");
|
|
34
34
|
const Err = __importStar(require("../../helpers/errors"));
|
|
35
|
-
const proto_rpc_1 = require("@streamr/proto-rpc");
|
|
36
35
|
const peerIdFromPeerDescriptor_1 = require("../../helpers/peerIdFromPeerDescriptor");
|
|
37
36
|
const WebrtcConnectorRpcLocal_1 = require("./WebrtcConnectorRpcLocal");
|
|
38
37
|
const logger = new utils_1.Logger(module);
|
|
@@ -50,9 +49,8 @@ class WebrtcConnector {
|
|
|
50
49
|
this.ongoingConnectAttempts = new Map();
|
|
51
50
|
this.stopped = false;
|
|
52
51
|
this.config = config;
|
|
53
|
-
this.iceServers = config.iceServers ?? [];
|
|
54
52
|
this.rpcCommunicator = new ListeningRpcCommunicator_1.ListeningRpcCommunicator(WebrtcConnector.WEBRTC_CONNECTOR_SERVICE_ID, config.transport, {
|
|
55
|
-
rpcRequestTimeout: 15000
|
|
53
|
+
rpcRequestTimeout: 15000 // TODO use config option or named constant?
|
|
56
54
|
});
|
|
57
55
|
this.registerLocalRpcMethods(config, onNewConnection);
|
|
58
56
|
}
|
|
@@ -103,14 +101,14 @@ class WebrtcConnector {
|
|
|
103
101
|
throw new Err.CannotConnectToSelf('Cannot open WebRTC Connection to self');
|
|
104
102
|
}
|
|
105
103
|
logger.trace(`Opening WebRTC connection to ${(0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor)}`);
|
|
106
|
-
const
|
|
107
|
-
const existingConnection = this.ongoingConnectAttempts.get(
|
|
104
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor);
|
|
105
|
+
const existingConnection = this.ongoingConnectAttempts.get(nodeId);
|
|
108
106
|
if (existingConnection) {
|
|
109
107
|
return existingConnection;
|
|
110
108
|
}
|
|
111
109
|
const connection = new NodeWebrtcConnection_1.NodeWebrtcConnection({
|
|
112
110
|
remotePeerDescriptor: targetPeerDescriptor,
|
|
113
|
-
iceServers: this.iceServers,
|
|
111
|
+
iceServers: this.config.iceServers,
|
|
114
112
|
bufferThresholdLow: this.config.bufferThresholdLow,
|
|
115
113
|
bufferThresholdHigh: this.config.bufferThresholdHigh,
|
|
116
114
|
connectingTimeout: this.config.connectionTimeout,
|
|
@@ -125,15 +123,15 @@ class WebrtcConnector {
|
|
|
125
123
|
managedConnection = new ManagedWebrtcConnection_1.ManagedWebrtcConnection(this.localPeerDescriptor, undefined, connection);
|
|
126
124
|
}
|
|
127
125
|
managedConnection.setRemotePeerDescriptor(targetPeerDescriptor);
|
|
128
|
-
this.ongoingConnectAttempts.set((0, peerIdFromPeerDescriptor_1.
|
|
126
|
+
this.ongoingConnectAttempts.set((0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor), managedConnection);
|
|
129
127
|
const delFunc = () => {
|
|
130
|
-
this.ongoingConnectAttempts.delete(
|
|
128
|
+
this.ongoingConnectAttempts.delete(nodeId);
|
|
131
129
|
connection.off('disconnected', delFunc);
|
|
132
130
|
managedConnection.off('handshakeCompleted', delFunc);
|
|
133
131
|
};
|
|
134
132
|
connection.on('disconnected', delFunc);
|
|
135
133
|
managedConnection.on('handshakeCompleted', delFunc);
|
|
136
|
-
const remoteConnector = new WebrtcConnectorRpcRemote_1.WebrtcConnectorRpcRemote(this.localPeerDescriptor, targetPeerDescriptor,
|
|
134
|
+
const remoteConnector = new WebrtcConnectorRpcRemote_1.WebrtcConnectorRpcRemote(this.localPeerDescriptor, targetPeerDescriptor, 'DUMMY', this.rpcCommunicator, DhtRpc_client_1.WebrtcConnectorRpcClient);
|
|
137
135
|
connection.on('localCandidate', (candidate, mid) => {
|
|
138
136
|
if (this.config.externalIp !== undefined) {
|
|
139
137
|
candidate = (0, exports.replaceInternalIpWithExternalIp)(candidate, this.config.externalIp);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebrtcConnector.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAK+C;AAE/C,uFAAmF;AACnF,iEAA6D;AAC7D,yEAAqE;AACrE,iFAAwF;
|
|
1
|
+
{"version":3,"file":"WebrtcConnector.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAK+C;AAE/C,uFAAmF;AACnF,iEAA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A4B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ServerCallContext } from '@protobuf-ts/runtime-rpc';
|
|
2
|
-
import { PeerIDKey } from '../../helpers/PeerID';
|
|
3
2
|
import { Empty } from '../../proto/google/protobuf/empty';
|
|
4
3
|
import { IceCandidate, PeerDescriptor, RtcAnswer, RtcOffer } from '../../proto/packages/dht/protos/DhtRpc';
|
|
5
4
|
import { IWebrtcConnectorRpc } from '../../proto/packages/dht/protos/DhtRpc.server';
|
|
6
5
|
import { ListeningRpcCommunicator } from '../../transport/ListeningRpcCommunicator';
|
|
7
6
|
import { ManagedConnection } from '../ManagedConnection';
|
|
8
7
|
import { ManagedWebrtcConnection } from '../ManagedWebrtcConnection';
|
|
8
|
+
import { NodeID } from '../../helpers/nodeId';
|
|
9
9
|
interface WebrtcConnectorRpcLocalConfig {
|
|
10
10
|
connect: (targetPeerDescriptor: PeerDescriptor) => ManagedConnection;
|
|
11
11
|
onNewConnection: (connection: ManagedConnection) => boolean;
|
|
12
|
-
ongoingConnectAttempts: Map<
|
|
12
|
+
ongoingConnectAttempts: Map<NodeID, ManagedWebrtcConnection>;
|
|
13
13
|
rpcCommunicator: ListeningRpcCommunicator;
|
|
14
14
|
getLocalPeerDescriptor: () => PeerDescriptor;
|
|
15
15
|
allowPrivateAddresses: boolean;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebrtcConnectorRpcLocal = void 0;
|
|
4
|
-
const proto_rpc_1 = require("@streamr/proto-rpc");
|
|
5
4
|
const utils_1 = require("@streamr/utils");
|
|
6
5
|
const AddressTools_1 = require("../../helpers/AddressTools");
|
|
7
6
|
const peerIdFromPeerDescriptor_1 = require("../../helpers/peerIdFromPeerDescriptor");
|
|
7
|
+
const DhtRpc_1 = require("../../proto/packages/dht/protos/DhtRpc");
|
|
8
8
|
const DhtRpc_client_1 = require("../../proto/packages/dht/protos/DhtRpc.client");
|
|
9
9
|
const ManagedWebrtcConnection_1 = require("../ManagedWebrtcConnection");
|
|
10
10
|
const NodeWebrtcConnection_1 = require("./NodeWebrtcConnection");
|
|
11
11
|
const WebrtcConnectorRpcRemote_1 = require("./WebrtcConnectorRpcRemote");
|
|
12
|
+
const package_json_1 = require("../../../package.json");
|
|
13
|
+
const versionCompatibility_1 = require("../../helpers/versionCompatibility");
|
|
12
14
|
const logger = new utils_1.Logger(module);
|
|
13
15
|
class WebrtcConnectorRpcLocal {
|
|
14
16
|
constructor(config) {
|
|
@@ -16,7 +18,7 @@ class WebrtcConnectorRpcLocal {
|
|
|
16
18
|
}
|
|
17
19
|
async requestConnection(context) {
|
|
18
20
|
const targetPeerDescriptor = context.incomingSourceDescriptor;
|
|
19
|
-
if (this.config.ongoingConnectAttempts.has((0, peerIdFromPeerDescriptor_1.
|
|
21
|
+
if (this.config.ongoingConnectAttempts.has((0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor))) {
|
|
20
22
|
return {};
|
|
21
23
|
}
|
|
22
24
|
const managedConnection = this.config.connect(targetPeerDescriptor);
|
|
@@ -26,16 +28,16 @@ class WebrtcConnectorRpcLocal {
|
|
|
26
28
|
}
|
|
27
29
|
async rtcOffer(request, context) {
|
|
28
30
|
const remotePeer = context.incomingSourceDescriptor;
|
|
29
|
-
const
|
|
30
|
-
let managedConnection = this.config.ongoingConnectAttempts.get(
|
|
31
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(remotePeer);
|
|
32
|
+
let managedConnection = this.config.ongoingConnectAttempts.get(nodeId);
|
|
31
33
|
let connection = managedConnection?.getWebrtcConnection();
|
|
32
34
|
if (!managedConnection) {
|
|
33
35
|
connection = new NodeWebrtcConnection_1.NodeWebrtcConnection({ remotePeerDescriptor: remotePeer });
|
|
34
36
|
managedConnection = new ManagedWebrtcConnection_1.ManagedWebrtcConnection(this.config.getLocalPeerDescriptor(), undefined, connection);
|
|
35
37
|
managedConnection.setRemotePeerDescriptor(remotePeer);
|
|
36
|
-
this.config.ongoingConnectAttempts.set(
|
|
38
|
+
this.config.ongoingConnectAttempts.set(nodeId, managedConnection);
|
|
37
39
|
this.config.onNewConnection(managedConnection);
|
|
38
|
-
const remoteConnector = new WebrtcConnectorRpcRemote_1.WebrtcConnectorRpcRemote(this.config.getLocalPeerDescriptor(), remotePeer,
|
|
40
|
+
const remoteConnector = new WebrtcConnectorRpcRemote_1.WebrtcConnectorRpcRemote(this.config.getLocalPeerDescriptor(), remotePeer, 'DUMMY', this.config.rpcCommunicator, DhtRpc_client_1.WebrtcConnectorRpcClient);
|
|
39
41
|
connection.on('localCandidate', (candidate, mid) => {
|
|
40
42
|
remoteConnector.sendIceCandidate(candidate, mid, connection.connectionId.toString());
|
|
41
43
|
});
|
|
@@ -47,18 +49,23 @@ class WebrtcConnectorRpcLocal {
|
|
|
47
49
|
// Always use offerers connectionId
|
|
48
50
|
connection.setConnectionId(request.connectionId);
|
|
49
51
|
connection.setRemoteDescription(request.description, 'offer');
|
|
50
|
-
managedConnection.on('handshakeRequest', () => {
|
|
51
|
-
if (this.config.ongoingConnectAttempts.has(
|
|
52
|
-
this.config.ongoingConnectAttempts.delete(
|
|
52
|
+
managedConnection.on('handshakeRequest', (_sourceDescriptor, sourceVersion) => {
|
|
53
|
+
if (this.config.ongoingConnectAttempts.has(nodeId)) {
|
|
54
|
+
this.config.ongoingConnectAttempts.delete(nodeId);
|
|
55
|
+
}
|
|
56
|
+
if (!(0, versionCompatibility_1.isCompatibleVersion)(sourceVersion, package_json_1.version)) {
|
|
57
|
+
managedConnection.rejectHandshake(DhtRpc_1.HandshakeError.UNSUPPORTED_VERSION);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
managedConnection.acceptHandshake();
|
|
53
61
|
}
|
|
54
|
-
managedConnection.acceptHandshake();
|
|
55
62
|
});
|
|
56
63
|
return {};
|
|
57
64
|
}
|
|
58
65
|
async rtcAnswer(request, context) {
|
|
59
66
|
const remotePeerDescriptor = context.incomingSourceDescriptor;
|
|
60
|
-
const
|
|
61
|
-
const connection = this.config.ongoingConnectAttempts.get(
|
|
67
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(remotePeerDescriptor);
|
|
68
|
+
const connection = this.config.ongoingConnectAttempts.get(nodeId)?.getWebrtcConnection();
|
|
62
69
|
if (!connection) {
|
|
63
70
|
return {};
|
|
64
71
|
}
|
|
@@ -71,8 +78,8 @@ class WebrtcConnectorRpcLocal {
|
|
|
71
78
|
}
|
|
72
79
|
async iceCandidate(request, context) {
|
|
73
80
|
const remotePeerDescriptor = context.incomingSourceDescriptor;
|
|
74
|
-
const
|
|
75
|
-
const connection = this.config.ongoingConnectAttempts.get(
|
|
81
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(remotePeerDescriptor);
|
|
82
|
+
const connection = this.config.ongoingConnectAttempts.get(nodeId)?.getWebrtcConnection();
|
|
76
83
|
if (!connection) {
|
|
77
84
|
return {};
|
|
78
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebrtcConnectorRpcLocal.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnectorRpcLocal.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"WebrtcConnectorRpcLocal.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnectorRpcLocal.ts"],"names":[],"mappings":";;;AACA,0CAAuC;AACvC,6DAAsF;AACtF,qFAAoF;AAEpF,mEAM+C;AAC/C,iFAAwF;AAKxF,wEAAoE;AACpE,iEAA6D;AAC7D,yEAAqE;AAErE,wDAA+C;AAC/C,6EAAwE;AAExE,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAYjC,MAAa,uBAAuB;IAIhC,YAAY,MAAqC;QAC7C,IAAI,CAAC,MAAM,GA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AS,CAAC,EAAE;YACtD,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;SAChE;QACD,OAAO,EAAE,CAAA;IACb,CAAC;IAEO,qBAAqB,CAAC,SAAiB;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACpC,MAAM,OAAO,GAAG,IAAA,yCAA0B,EAAC,SAAS,CAAC,CAAA;YACrD,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,IAAI,IAAA,4BAAa,EAAC,OAAO,CAAC,EAAE;gBACnD,OAAO,KAAK,CAAA;aACf;SACJ;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;AAtGD,0DAsGC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { RpcRemote } from '../../dht/contact/RpcRemote';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ProtoRpcClient } from '@streamr/proto-rpc';
|
|
5
|
-
export declare class WebrtcConnectorRpcRemote extends RpcRemote<IWebrtcConnectorRpcClient> {
|
|
6
|
-
constructor(localPeerDescriptor: PeerDescriptor, remotePeerDescriptor: PeerDescriptor, client: ProtoRpcClient<IWebrtcConnectorRpcClient>);
|
|
2
|
+
import { WebrtcConnectorRpcClient } from '../../proto/packages/dht/protos/DhtRpc.client';
|
|
3
|
+
export declare class WebrtcConnectorRpcRemote extends RpcRemote<WebrtcConnectorRpcClient> {
|
|
7
4
|
requestConnection(): void;
|
|
8
5
|
sendRtcOffer(description: string, connectionId: string): void;
|
|
9
6
|
sendRtcAnswer(description: string, connectionId: string): void;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebrtcConnectorRpcRemote = void 0;
|
|
4
|
-
const RpcRemote_1 = require("../../dht/contact/RpcRemote");
|
|
5
4
|
const utils_1 = require("@streamr/utils");
|
|
5
|
+
const RpcRemote_1 = require("../../dht/contact/RpcRemote");
|
|
6
6
|
const logger = new utils_1.Logger(module);
|
|
7
7
|
class WebrtcConnectorRpcRemote extends RpcRemote_1.RpcRemote {
|
|
8
|
-
constructor(localPeerDescriptor, remotePeerDescriptor, client) {
|
|
9
|
-
super(localPeerDescriptor, remotePeerDescriptor, 'DUMMY', client);
|
|
10
|
-
}
|
|
11
8
|
requestConnection() {
|
|
12
9
|
const request = {};
|
|
13
10
|
const options = this.formDhtRpcOptions({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebrtcConnectorRpcRemote.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnectorRpcRemote.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"WebrtcConnectorRpcRemote.js","sourceRoot":"","sources":["../../../../src/connection/webrtc/WebrtcConnectorRpcRemote.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,2DAAuD;AASvD,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,wBAAyB,SAAQ,qBAAmC;IAE7E,iBAAiB;QACb,MAAM,OAAO,GAA4B,EACxC,CAAA;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACnC,YAAY,EAAE,IAAI;SACrB,CAAC,CAAA;QACF,IAAI,CAAC,SAAS,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;YAC9D,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;QACpD,CAAC,CAAC,CAAA;IACN,CAAC;IAED,YAAY,CAAC,WAAmB,EAAE,YAAoB;QAClD,MAAM,OAAO,GAAa;YACtB,YAAY;YACZ,WAAW;SACd,CAAA;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;YACrD,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;IACN,CAAC;IAED,aAAa,CAAC,WAAmB,EAAE,YAAoB;QACnD,MAAM,OAAO,GAAc;YACvB,YAAY;YACZ,WAAW;SACd,CAAA;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;YACtD,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;IACN,CAAC;IAED,gBAAgB,CAAC,SAAiB,EAAE,GAAW,EAAE,YAAoB;QACjE,MAAM,OAAO,GAAiB;YAC1B,YAAY;YACZ,GAAG;YACH,SAAS;SACZ,CAAA;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,SAAS,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;YACzD,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AA9CD,4DA8CC"}
|
|
@@ -17,8 +17,7 @@ interface AutoCertifierClientFacadeConfig {
|
|
|
17
17
|
export declare class AutoCertifierClientFacade {
|
|
18
18
|
private autoCertifierClient;
|
|
19
19
|
private readonly rpcCommunicator;
|
|
20
|
-
private readonly
|
|
21
|
-
private readonly updateCertificate;
|
|
20
|
+
private readonly config;
|
|
22
21
|
constructor(config: AutoCertifierClientFacadeConfig);
|
|
23
22
|
start(): Promise<void>;
|
|
24
23
|
stop(): void;
|
|
@@ -11,16 +11,15 @@ const defaultAutoCertifierClientFactory = (configFile, autoCertifierUrl, autoCer
|
|
|
11
11
|
const logger = new utils_1.Logger(module);
|
|
12
12
|
class AutoCertifierClientFacade {
|
|
13
13
|
constructor(config) {
|
|
14
|
-
this.
|
|
15
|
-
this.updateCertificate = config.updateCertificate;
|
|
14
|
+
this.config = config;
|
|
16
15
|
this.rpcCommunicator = new ListeningRpcCommunicator_1.ListeningRpcCommunicator(autocertifier_client_1.SERVICE_ID, config.transport);
|
|
17
16
|
this.autoCertifierClient = config.createClientFactory ? config.createClientFactory()
|
|
18
17
|
: defaultAutoCertifierClientFactory(config.configFile, config.url, this.rpcCommunicator, config.wsServerPort);
|
|
19
18
|
}
|
|
20
19
|
async start() {
|
|
21
20
|
this.autoCertifierClient.on('updatedCertificate', (subdomain) => {
|
|
22
|
-
this.setHost(subdomain.fqdn);
|
|
23
|
-
this.updateCertificate(subdomain.certificate, subdomain.privateKey);
|
|
21
|
+
this.config.setHost(subdomain.fqdn);
|
|
22
|
+
this.config.updateCertificate(subdomain.certificate, subdomain.privateKey);
|
|
24
23
|
logger.trace(`Updated certificate`);
|
|
25
24
|
});
|
|
26
25
|
await Promise.all([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCertifierClientFacade.js","sourceRoot":"","sources":["../../../../src/connection/websocket/AutoCertifierClientFacade.ts"],"names":[],"mappings":";;;AAAA,wEAOsC;AACtC,uFAAmF;AACnF,0CAAsD;AAGtD,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;AAE/B,MAAM,iCAAiC,GAAG,CACtC,UAAkB,EAClB,gBAAwB,EACxB,4BAAsD,EACtD,YAAoB,EACtB,EAAE,CAAC,IAAI,0CAAmB,CACxB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,CAAC,UAAkB,EAAE,aAAqB,EAAE,MAAkB,EAAE,EAAE;IAC9D,4BAA4B,CAAC,iBAAiB,CAC1C,wCAAiB,EACjB,yCAAkB,EAClB,aAAa,EACb,MAAM,CACT,CAAA;AACL,CAAC,CACJ,CAAA;AAoBD,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,yBAAyB;
|
|
1
|
+
{"version":3,"file":"AutoCertifierClientFacade.js","sourceRoot":"","sources":["../../../../src/connection/websocket/AutoCertifierClientFacade.ts"],"names":[],"mappings":";;;AAAA,wEAOsC;AACtC,uFAAmF;AACnF,0CAAsD;AAGtD,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;AAE/B,MAAM,iCAAiC,GAAG,CACtC,UAAkB,EAClB,gBAAwB,EACxB,4BAAsD,EACtD,YAAoB,EACtB,EAAE,CAAC,IAAI,0CAAmB,CACxB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,CAAC,UAAkB,EAAE,aAAqB,EAAE,MAAkB,EAAE,EAAE;IAC9D,4BAA4B,CAAC,iBAAiB,CAC1C,wCAAiB,EACjB,yCAAkB,EAClB,aAAa,EACb,MAAM,CACT,CAAA;AACL,CAAC,CACJ,CAAA;AAoBD,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,yBAAyB;IAMlC,YAAY,MAAuC;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,eAAe,GAAG,IAAI,mDAAwB,CAAC,iCAAyB,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;QAChG,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE;YAChF,CAAC,CAAC,iCAAiC,CAC/B,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,GAAG,EACV,IAAI,CAAC,eAAe,EACpB,MAAM,CAAC,YAAY,CACtB,CAAA;IACT,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,SAA6B,EAAE,EAAE;YAChF,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;YAC1E,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;QACF,MAAM,OAAO,CAAC,GAAG,CAAC;YACd,IAAA,qBAAa,EAAC,IAAI,CAAC,mBAA0B,EAAE,oBAAoB,EAAE,aAAa,CAAC;YACnF,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE;SACnC,CAAC,CAAA;IACN,CAAC;IAED,IAAI;QACA,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAA;IAClC,CAAC;CAEJ;AAnCD,8DAmCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientWebsocket.js","sourceRoot":"","sources":["../../../../src/connection/websocket/ClientWebsocket.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAuC;AACvC,kEAAwC;AACxC,yCAAiF;AACjF,gDAA4F;AAE5F,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,mGAAmG;AACnG,sDAAsD;AACzC,QAAA,UAAU,GAAG,IAAI,CAAA;AAC9B,+FAA+F;AAC/F,+BAA+B;AAClB,QAAA,iBAAiB,GAAG,IAAI,CAAA;AAErC,MAAM,WAAW,GAAG,aAAa,CAAA;AAEjC,MAAa,eAAgB,SAAQ,uBAA8B;
|
|
1
|
+
{"version":3,"file":"ClientWebsocket.js","sourceRoot":"","sources":["../../../../src/connection/websocket/ClientWebsocket.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAuC;AACvC,kEAAwC;AACxC,yCAAiF;AACjF,gDAA4F;AAE5F,MAAM,M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AAA;YAC1D,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAoC,CAAA;SAC/D;IACL,CAAC;IAEM,OAAO;QACV,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,IAAI,CAAC,MAAM,EAAE;gBACb,IAAI,CAAC,aAAa,EAAE,CAAA;gBACpB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;gBACnB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;aAC1B;YACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;SACxB;aAAM;YACH,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;SAC1D;IACL,CAAC;CACJ;AA/GD,0CA+GC"}
|
|
@@ -7,6 +7,7 @@ export declare const connectivityMethodToWebsocketUrl: (ws: ConnectivityMethod,
|
|
|
7
7
|
export interface WebsocketConnectorConfig {
|
|
8
8
|
transport: ITransport;
|
|
9
9
|
onNewConnection: (connection: ManagedConnection) => boolean;
|
|
10
|
+
hasConnection: (peerDescriptor: PeerDescriptor) => boolean;
|
|
10
11
|
portRange?: PortRange;
|
|
11
12
|
maxMessageSize?: number;
|
|
12
13
|
host?: string;
|
|
@@ -22,19 +23,13 @@ export declare class WebsocketConnector {
|
|
|
22
23
|
private readonly rpcCommunicator;
|
|
23
24
|
private readonly websocketServer?;
|
|
24
25
|
private readonly ongoingConnectRequests;
|
|
25
|
-
private onNewConnection;
|
|
26
26
|
private host?;
|
|
27
|
-
private readonly entrypoints?;
|
|
28
|
-
private readonly tlsCertificate?;
|
|
29
|
-
private readonly autoCertifierTransport;
|
|
30
|
-
private readonly autoCertifierUrl;
|
|
31
|
-
private readonly autoCertifierConfigFile;
|
|
32
|
-
private readonly serverEnableTls;
|
|
33
27
|
private autoCertifierClient?;
|
|
34
28
|
private selectedPort?;
|
|
35
29
|
private localPeerDescriptor?;
|
|
36
30
|
private connectingConnections;
|
|
37
31
|
private abortController;
|
|
32
|
+
private readonly config;
|
|
38
33
|
constructor(config: WebsocketConnectorConfig);
|
|
39
34
|
private registerLocalRpcMethods;
|
|
40
35
|
private attachHandshaker;
|
|
@@ -36,7 +36,6 @@ const ManagedConnection_1 = require("../ManagedConnection");
|
|
|
36
36
|
const WebsocketServer_1 = require("./WebsocketServer");
|
|
37
37
|
const connectivityChecker_1 = require("../connectivityChecker");
|
|
38
38
|
const ConnectionManager_1 = require("../ConnectionManager");
|
|
39
|
-
const proto_rpc_1 = require("@streamr/proto-rpc");
|
|
40
39
|
const Handshaker_1 = require("../Handshaker");
|
|
41
40
|
const peerIdFromPeerDescriptor_1 = require("../../helpers/peerIdFromPeerDescriptor");
|
|
42
41
|
const lodash_1 = require("lodash");
|
|
@@ -45,6 +44,8 @@ const errors_1 = require("../../helpers/errors");
|
|
|
45
44
|
const AutoCertifierClientFacade_1 = require("./AutoCertifierClientFacade");
|
|
46
45
|
const connectivityRequestHandler_1 = require("../connectivityRequestHandler");
|
|
47
46
|
const Err = __importStar(require("../../helpers/errors"));
|
|
47
|
+
const package_json_1 = require("../../../package.json");
|
|
48
|
+
const versionCompatibility_1 = require("../../helpers/versionCompatibility");
|
|
48
49
|
const logger = new utils_1.Logger(module);
|
|
49
50
|
const connectivityMethodToWebsocketUrl = (ws, action) => {
|
|
50
51
|
return (ws.tls ? 'wss://' : 'ws://') + ws.host + ':' + ws.port + ((action !== undefined) ? '?action=' + action : '');
|
|
@@ -56,22 +57,16 @@ class WebsocketConnector {
|
|
|
56
57
|
this.ongoingConnectRequests = new Map();
|
|
57
58
|
this.connectingConnections = new Map();
|
|
58
59
|
this.abortController = new AbortController();
|
|
60
|
+
this.config = config;
|
|
59
61
|
this.websocketServer = config.portRange ? new WebsocketServer_1.WebsocketServer({
|
|
60
62
|
portRange: config.portRange,
|
|
61
63
|
tlsCertificate: config.tlsCertificate,
|
|
62
64
|
maxMessageSize: config.maxMessageSize,
|
|
63
65
|
enableTls: config.serverEnableTls
|
|
64
66
|
}) : undefined;
|
|
65
|
-
this.onNewConnection = config.onNewConnection;
|
|
66
67
|
this.host = config.host;
|
|
67
|
-
this.entrypoints = config.entrypoints;
|
|
68
|
-
this.tlsCertificate = config.tlsCertificate;
|
|
69
|
-
this.autoCertifierTransport = config.autoCertifierTransport;
|
|
70
|
-
this.autoCertifierUrl = config.autoCertifierUrl;
|
|
71
|
-
this.autoCertifierConfigFile = config.autoCertifierConfigFile;
|
|
72
|
-
this.serverEnableTls = config.serverEnableTls;
|
|
73
68
|
this.rpcCommunicator = new ListeningRpcCommunicator_1.ListeningRpcCommunicator(WebsocketConnector.WEBSOCKET_CONNECTOR_SERVICE_ID, config.transport, {
|
|
74
|
-
rpcRequestTimeout: 15000
|
|
69
|
+
rpcRequestTimeout: 15000 // TODO use config option or named constant?
|
|
75
70
|
});
|
|
76
71
|
this.registerLocalRpcMethods(config);
|
|
77
72
|
}
|
|
@@ -79,10 +74,11 @@ class WebsocketConnector {
|
|
|
79
74
|
const rpcLocal = new WebsocketConnectorRpcLocal_1.WebsocketConnectorRpcLocal({
|
|
80
75
|
connect: (targetPeerDescriptor) => this.connect(targetPeerDescriptor),
|
|
81
76
|
hasConnection: (targetPeerDescriptor) => {
|
|
82
|
-
const
|
|
83
|
-
if (this.connectingConnections.has(
|
|
84
|
-
|| this.connectingConnections.has(
|
|
85
|
-
|| this.ongoingConnectRequests.has(
|
|
77
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor);
|
|
78
|
+
if (this.connectingConnections.has(nodeId)
|
|
79
|
+
|| this.connectingConnections.has(nodeId)
|
|
80
|
+
|| this.ongoingConnectRequests.has(nodeId)
|
|
81
|
+
|| config.hasConnection(targetPeerDescriptor)) {
|
|
86
82
|
return true;
|
|
87
83
|
}
|
|
88
84
|
else {
|
|
@@ -92,26 +88,26 @@ class WebsocketConnector {
|
|
|
92
88
|
onNewConnection: (connection) => config.onNewConnection(connection),
|
|
93
89
|
abortSignal: this.abortController.signal
|
|
94
90
|
});
|
|
95
|
-
this.rpcCommunicator.
|
|
91
|
+
this.rpcCommunicator.registerRpcNotification(DhtRpc_1.WebsocketConnectionRequest, 'requestConnection', async (req, context) => {
|
|
96
92
|
if (!this.abortController.signal.aborted) {
|
|
97
93
|
return rpcLocal.requestConnection(req, context);
|
|
98
94
|
}
|
|
99
95
|
else {
|
|
100
|
-
return {
|
|
96
|
+
return {};
|
|
101
97
|
}
|
|
102
98
|
});
|
|
103
99
|
}
|
|
104
100
|
attachHandshaker(connection) {
|
|
105
101
|
const handshaker = new Handshaker_1.Handshaker(this.localPeerDescriptor, connection);
|
|
106
|
-
handshaker.once('handshakeRequest', (localPeerDescriptor, remotePeerDescriptor) => {
|
|
107
|
-
this.onServerSocketHandshakeRequest(localPeerDescriptor, connection, remotePeerDescriptor);
|
|
102
|
+
handshaker.once('handshakeRequest', (localPeerDescriptor, sourceVersion, remotePeerDescriptor) => {
|
|
103
|
+
this.onServerSocketHandshakeRequest(localPeerDescriptor, connection, sourceVersion, remotePeerDescriptor);
|
|
108
104
|
});
|
|
109
105
|
}
|
|
110
106
|
async autoCertify() {
|
|
111
107
|
this.autoCertifierClient = new AutoCertifierClientFacade_1.AutoCertifierClientFacade({
|
|
112
|
-
configFile: this.autoCertifierConfigFile,
|
|
113
|
-
transport: this.autoCertifierTransport,
|
|
114
|
-
url: this.autoCertifierUrl,
|
|
108
|
+
configFile: this.config.autoCertifierConfigFile,
|
|
109
|
+
transport: this.config.autoCertifierTransport,
|
|
110
|
+
url: this.config.autoCertifierUrl,
|
|
115
111
|
wsServerPort: this.selectedPort,
|
|
116
112
|
setHost: (hostName) => this.setHost(hostName),
|
|
117
113
|
updateCertificate: (certificate, privateKey) => this.websocketServer.updateCertificate(certificate, privateKey)
|
|
@@ -154,18 +150,18 @@ class WebsocketConnector {
|
|
|
154
150
|
return noServerConnectivityResponse;
|
|
155
151
|
}
|
|
156
152
|
for (const reattempt of (0, lodash_1.range)(ENTRY_POINT_CONNECTION_ATTEMPTS)) {
|
|
157
|
-
const entryPoint = (0, lodash_1.sample)(this.entrypoints);
|
|
153
|
+
const entryPoint = (0, lodash_1.sample)(this.config.entrypoints);
|
|
158
154
|
try {
|
|
159
155
|
if (!this.websocketServer) {
|
|
160
156
|
return noServerConnectivityResponse;
|
|
161
157
|
}
|
|
162
158
|
else {
|
|
163
|
-
if (!this.entrypoints || this.entrypoints.length === 0) {
|
|
159
|
+
if (!this.config.entrypoints || this.config.entrypoints.length === 0) {
|
|
164
160
|
// return connectivity info given in config
|
|
165
161
|
const preconfiguredConnectivityResponse = {
|
|
166
162
|
host: this.host,
|
|
167
163
|
natType: ConnectionManager_1.NatType.OPEN_INTERNET,
|
|
168
|
-
websocket: { host: this.host, port: this.selectedPort, tls: this.tlsCertificate !== undefined }
|
|
164
|
+
websocket: { host: this.host, port: this.selectedPort, tls: this.config.tlsCertificate !== undefined }
|
|
169
165
|
};
|
|
170
166
|
return preconfiguredConnectivityResponse;
|
|
171
167
|
}
|
|
@@ -174,7 +170,7 @@ class WebsocketConnector {
|
|
|
174
170
|
const connectivityRequest = {
|
|
175
171
|
port: this.selectedPort,
|
|
176
172
|
host: this.host,
|
|
177
|
-
tls: this.serverEnableTls,
|
|
173
|
+
tls: this.config.serverEnableTls,
|
|
178
174
|
selfSigned
|
|
179
175
|
};
|
|
180
176
|
if (!this.abortController.signal.aborted) {
|
|
@@ -202,8 +198,8 @@ class WebsocketConnector {
|
|
|
202
198
|
return (connectionType === IConnection_1.ConnectionType.WEBSOCKET_CLIENT || connectionType === IConnection_1.ConnectionType.WEBSOCKET_SERVER);
|
|
203
199
|
}
|
|
204
200
|
connect(targetPeerDescriptor) {
|
|
205
|
-
const
|
|
206
|
-
const existingConnection = this.connectingConnections.get(
|
|
201
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor);
|
|
202
|
+
const existingConnection = this.connectingConnections.get(nodeId);
|
|
207
203
|
if (existingConnection) {
|
|
208
204
|
return existingConnection;
|
|
209
205
|
}
|
|
@@ -215,10 +211,10 @@ class WebsocketConnector {
|
|
|
215
211
|
const url = (0, exports.connectivityMethodToWebsocketUrl)(targetPeerDescriptor.websocket);
|
|
216
212
|
const managedConnection = new ManagedConnection_1.ManagedConnection(this.localPeerDescriptor, IConnection_1.ConnectionType.WEBSOCKET_CLIENT, socket, undefined, targetPeerDescriptor);
|
|
217
213
|
managedConnection.setRemotePeerDescriptor(targetPeerDescriptor);
|
|
218
|
-
this.connectingConnections.set((0, peerIdFromPeerDescriptor_1.
|
|
214
|
+
this.connectingConnections.set((0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor), managedConnection);
|
|
219
215
|
const delFunc = () => {
|
|
220
|
-
if (this.connectingConnections.has(
|
|
221
|
-
this.connectingConnections.delete(
|
|
216
|
+
if (this.connectingConnections.has(nodeId)) {
|
|
217
|
+
this.connectingConnections.delete(nodeId);
|
|
222
218
|
}
|
|
223
219
|
socket.off('disconnected', delFunc);
|
|
224
220
|
managedConnection.off('handshakeCompleted', delFunc);
|
|
@@ -231,37 +227,45 @@ class WebsocketConnector {
|
|
|
231
227
|
}
|
|
232
228
|
requestConnectionFromPeer(localPeerDescriptor, targetPeerDescriptor) {
|
|
233
229
|
setImmediate(() => {
|
|
234
|
-
const remoteConnector = new WebsocketConnectorRpcRemote_1.WebsocketConnectorRpcRemote(localPeerDescriptor, targetPeerDescriptor,
|
|
235
|
-
remoteConnector.requestConnection().then((
|
|
236
|
-
logger.trace('Sent WebsocketConnectionRequest
|
|
230
|
+
const remoteConnector = new WebsocketConnectorRpcRemote_1.WebsocketConnectorRpcRemote(localPeerDescriptor, targetPeerDescriptor, 'DUMMY', this.rpcCommunicator, DhtRpc_client_1.WebsocketConnectorRpcClient);
|
|
231
|
+
remoteConnector.requestConnection().then(() => {
|
|
232
|
+
logger.trace('Sent WebsocketConnectionRequest notification to peer', { targetPeerDescriptor });
|
|
237
233
|
return;
|
|
238
234
|
}, (err) => {
|
|
239
|
-
logger.debug('Failed to send WebsocketConnectionRequest
|
|
235
|
+
logger.debug('Failed to send WebsocketConnectionRequest notification to peer ', {
|
|
240
236
|
error: err, targetPeerDescriptor
|
|
241
237
|
});
|
|
242
238
|
});
|
|
243
239
|
});
|
|
244
240
|
const managedConnection = new ManagedConnection_1.ManagedConnection(this.localPeerDescriptor, IConnection_1.ConnectionType.WEBSOCKET_SERVER, undefined, undefined, targetPeerDescriptor);
|
|
245
|
-
managedConnection.on('disconnected', () => this.ongoingConnectRequests.delete((0, peerIdFromPeerDescriptor_1.
|
|
241
|
+
managedConnection.on('disconnected', () => this.ongoingConnectRequests.delete((0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor)));
|
|
246
242
|
managedConnection.setRemotePeerDescriptor(targetPeerDescriptor);
|
|
247
|
-
this.ongoingConnectRequests.set((0, peerIdFromPeerDescriptor_1.
|
|
243
|
+
this.ongoingConnectRequests.set((0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(targetPeerDescriptor), managedConnection);
|
|
248
244
|
return managedConnection;
|
|
249
245
|
}
|
|
250
|
-
onServerSocketHandshakeRequest(sourcePeerDescriptor, serverWebsocket, targetPeerDescriptor) {
|
|
251
|
-
const
|
|
252
|
-
if (this.ongoingConnectRequests.has(
|
|
253
|
-
const ongoingConnectRequest = this.ongoingConnectRequests.get(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
246
|
+
onServerSocketHandshakeRequest(sourcePeerDescriptor, serverWebsocket, sourceVersion, targetPeerDescriptor) {
|
|
247
|
+
const nodeId = (0, peerIdFromPeerDescriptor_1.getNodeIdFromPeerDescriptor)(sourcePeerDescriptor);
|
|
248
|
+
if (this.ongoingConnectRequests.has(nodeId)) {
|
|
249
|
+
const ongoingConnectRequest = this.ongoingConnectRequests.get(nodeId);
|
|
250
|
+
if (!(0, versionCompatibility_1.isCompatibleVersion)(sourceVersion, package_json_1.version)) {
|
|
251
|
+
ongoingConnectRequest.rejectHandshake(DhtRpc_1.HandshakeError.UNSUPPORTED_VERSION);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
ongoingConnectRequest.attachImplementation(serverWebsocket);
|
|
255
|
+
ongoingConnectRequest.acceptHandshake();
|
|
256
|
+
}
|
|
257
|
+
this.ongoingConnectRequests.delete(nodeId);
|
|
257
258
|
}
|
|
258
259
|
else {
|
|
259
260
|
const managedConnection = new ManagedConnection_1.ManagedConnection(this.localPeerDescriptor, IConnection_1.ConnectionType.WEBSOCKET_SERVER, undefined, serverWebsocket, targetPeerDescriptor);
|
|
260
261
|
managedConnection.setRemotePeerDescriptor(sourcePeerDescriptor);
|
|
261
|
-
if (
|
|
262
|
+
if (!(0, versionCompatibility_1.isCompatibleVersion)(sourceVersion, package_json_1.version)) {
|
|
263
|
+
managedConnection.rejectHandshake(DhtRpc_1.HandshakeError.UNSUPPORTED_VERSION);
|
|
264
|
+
}
|
|
265
|
+
else if (targetPeerDescriptor && !(0, peerIdFromPeerDescriptor_1.areEqualPeerDescriptors)(this.localPeerDescriptor, targetPeerDescriptor)) {
|
|
262
266
|
managedConnection.rejectHandshake(DhtRpc_1.HandshakeError.INVALID_TARGET_PEER_DESCRIPTOR);
|
|
263
267
|
}
|
|
264
|
-
else if (this.onNewConnection(managedConnection)) {
|
|
268
|
+
else if (this.config.onNewConnection(managedConnection)) {
|
|
265
269
|
managedConnection.acceptHandshake();
|
|
266
270
|
}
|
|
267
271
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebsocketConnector.js","sourceRoot":"","sources":["../../../../src/connection/websocket/WebsocketConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAmD;AACnD,gDAA4D;AAE5D,uFAAmF;AACnF,6EAAyE;AACzE,+EAA2E;AAC3E,
|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