MixinNetwork / kraken

🐙 High performance WebRTC SFU implemented with pure Go.
Apache License 2.0
335 stars 49 forks source link

Coturn to Kraken communication #11

Closed tycoles closed 4 years ago

tycoles commented 4 years ago

Hi, Cedric. Thanks for your work on this! I've been troubleshooting my current setup pretty extensively. I was trying to mock up a production configuration for kraken while using the kraken.fm source code to test it out. I'm using the latest code from both projects, btw. And I'm using the "relay" option in the kraken.fm code. Could you embellish on a proper setup for coturn to get this working? Thanks!

Current status:


2020/09/21 14:18:16 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:aa8888df-fc40-4c6f-8df1-7b34d2e593b8) OnSignalingStateChange(have-remote-offer)
2020/09/21 14:18:16 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:aa8888df-fc40-4c6f-8df1-7b34d2e593b8) OnICEConnectionStateChange(checking)
2020/09/21 14:18:16 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:aa8888df-fc40-4c6f-8df1-7b34d2e593b8) OnSignalingStateChange(stable)
2020/09/21 14:18:16 RPC.handle(id: 4d007d8a-76ee-4d0a-aa63-14f535455aa6, time: 0.026520s) OK
2020/09/21 14:18:16 RPC.handle(id: 6b2ecad7-4984-4c19-afcd-4b1fa2a38db6, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:16 RPC.handle(id: 6b2ecad7-4984-4c19-afcd-4b1fa2a38db6, time: 0.000125s) OK
2020/09/21 14:18:20 RPC.handle(id: a2b36796-57b2-4c80-89d7-70057c4535ff, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:20 RPC.handle(id: a2b36796-57b2-4c80-89d7-70057c4535ff, time: 0.000121s) OK
2020/09/21 14:18:23 RPC.handle(id: defe36ab-20ae-4cd5-ad70-7a2cecd0be9c, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:23 RPC.handle(id: defe36ab-20ae-4cd5-ad70-7a2cecd0be9c, time: 0.000090s) OK
2020/09/21 14:18:26 RPC.handle(id: fda56f2d-7f59-43bf-b77a-bdf86c8c9c2d, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:26 RPC.handle(id: fda56f2d-7f59-43bf-b77a-bdf86c8c9c2d, time: 0.000139s) OK
2020/09/21 14:18:26 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:aa8888df-fc40-4c6f-8df1-7b34d2e593b8) OnTrackTimeout()
2020/09/21 14:18:26 PeerClose(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:aa8888df-fc40-4c6f-8df1-7b34d2e593b8) now
2020/09/21 14:18:26 PeerClose(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:CLOSED) with <nil>
2020/09/21 14:18:26 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:CLOSED) OnConnectionStateChange(closed)
2020/09/21 14:18:26 HandlePeer(testing:ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D:CLOSED) OnICEConnectionStateChange(closed)
2020/09/21 14:18:29 RPC.handle(id: 72e68ef2-b410-4a91-9d30-92130868cd01, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:29 RPC.handle(id: 72e68ef2-b410-4a91-9d30-92130868cd01, time: 0.000090s) ERROR {"status":202,"code":5002002,"description":"peer ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D closed in testing"}
2020/09/21 14:18:32 RPC.handle(id: cde4f29a-df09-4606-87b4-229bf817e67b, method: subscribe, params: [testing ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D aa8888df-fc40-4c6f-8df1-7b34d2e593b8])
2020/09/21 14:18:32 RPC.handle(id: cde4f29a-df09-4606-87b4-229bf817e67b, time: 0.000089s) ERROR {"status":202,"code":5002002,"description":"peer ca5a8823-64e2-4b0f-9851-8fc9cd9cfb75%3ASGV5dGhlcmU%3D closed in testing"}```
cedricfung commented 4 years ago

You should configure both coturn and kraken to listen on the IP that can communicate to each other.

Similar issues https://github.com/MixinNetwork/kraken/issues/9

tycoles commented 4 years ago

Thanks Cedric! I was able to dig around some more and match my coturn settings similarly to the issue that you linked. I also was able to see that you included coturn.service, so that was helpful.