MixinNetwork / kraken

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

documentation questions #5

Open streaps opened 4 years ago

streaps commented 4 years ago

I have some questions that are not covered by the documentation:

Is port 9000 used for anything? (it shows up in netstat)

Do I need coturn or does kraken also work without a turnserver? https://github.com/MixinNetwork/kraken#quick-start doesn't mention a turnserver, but https://vec.io/posts/deploy-a-group-audio-conferencing-service does.

I'm running kraken inside a container with a local IP and and a reverse proxy on the public IP. Do I have to configure any additional port forwards? (UDP ports?)

cedricfung commented 4 years ago

9000 is for the default pprof endpoint for profiling. I should make it disabled by default and add an option to enable it.

TURN is not a requirement, but recommended for better connection.

I'm not familiar with container configurations, sorry.

streaps commented 4 years ago

I'm not familiar with container configurations, sorry.

I guess kraken is listening on some UDP port for the webrtc connection or how is the audio transmitted?

cedricfung commented 4 years ago

If you don't use turn, then you should open as many UDP ports as possible

cedricfung commented 4 years ago

I use turn server so that I could only open one port to the public, the the turn server connect with kraken via vpc

streaps commented 4 years ago

If you don't use turn, then you should open as many UDP ports as possible

I cannot forward all 65535 UDP ports to kraken. With other voip software you usually can configure a range of UDP ports. It's not clear which port range is used by kraken.

cedricfung commented 4 years ago

I will try to add some configurations for port range.

streaps commented 4 years ago

Thanks for the port range configuration commit. I'm still not sure how to use kraken and kraken.fm without a turn server.

I'm running kraken in an LXC container on a local IP, ports are forwarded from the public IP to the local IP. What should I put in TURNSERVER in kraken.fm/index.js or should I comment out iceServers and iceTransportPolicy?

I also don't know what the error message means:

$ ./kraken -c engine.toml 
2020/08/21 08:17:00 Setup(engine.toml)
2020/08/21 08:17:00 BuildEngine(IP: 10.0.2.3, Interface: eth0, Ports: 24000-24999)
2020/08/21 08:17:00 ServeRPC(:7000)
2020/08/21 08:17:00 RPC.handle(id: 75488318-0bdc-473f-97a0-31c4f4cc5001, method: subscribe, params: [time 9aa33dd5-6164-4c7f-81fb-26004e5c619d%3AaGhnZ2c%3D 213019e5-7ac9-4842-9ac8-ec4796841253])
2020/08/21 08:17:00 RPC.handle(id: 75488318-0bdc-473f-97a0-31c4f4cc5001, time: 0.001388s) ERROR {"status":202,"code":5002001,"description":"peer 9aa33dd5-6164-4c7f-81fb-26004e5c619d%3AaGhnZ2c%3D not found in time"}
dhyaniarun1993 commented 4 years ago

Hi,

I am facing same issue while running the server and client on local.

2020/09/02 19:55:47 RPC.handle(id: 6a742ea7-cebb-4f03-952b-a6fb6ec84d34, time: 0.000050s) OK 2020/09/02 19:55:50 RPC.handle(id: d487636e-e619-4b3c-bbec-9a5bb2f33e37, method: subscribe, params: [96d1f1a8-2d1a-4f2e-ac3c-950f78278742 6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D 535d3bf6-edb8-4115-93d4-0a005185cd11]) 2020/09/02 19:55:50 RPC.handle(id: d487636e-e619-4b3c-bbec-9a5bb2f33e37, time: 0.000051s) OK 2020/09/02 19:55:51 HandlePeer(96d1f1a8-2d1a-4f2e-ac3c-950f78278742:6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D:535d3bf6-edb8-4115-93d4-0a005185cd11) OnTrackTimeout() 2020/09/02 19:55:51 PeerClose(96d1f1a8-2d1a-4f2e-ac3c-950f78278742:6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D:535d3bf6-edb8-4115-93d4-0a005185cd11) now 2020/09/02 19:55:51 PeerClose(96d1f1a8-2d1a-4f2e-ac3c-950f78278742:6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D:CLOSED) with <nil> 2020/09/02 19:55:51 HandlePeer(96d1f1a8-2d1a-4f2e-ac3c-950f78278742:6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D:CLOSED) OnConnectionStateChange(closed) 2020/09/02 19:55:51 HandlePeer(96d1f1a8-2d1a-4f2e-ac3c-950f78278742:6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D:CLOSED) OnICEConnectionStateChange(closed) 2020/09/02 19:55:53 RPC.handle(id: be9d782a-c188-4e80-9f69-fd3eb0ef66bb, method: subscribe, params: [96d1f1a8-2d1a-4f2e-ac3c-950f78278742 6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D 535d3bf6-edb8-4115-93d4-0a005185cd11]) 2020/09/02 19:55:53 RPC.handle(id: be9d782a-c188-4e80-9f69-fd3eb0ef66bb, time: 0.000053s) ERROR {"status":202,"code":5002002,"description":"peer 6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D closed in 96d1f1a8-2d1a-4f2e-ac3c-950f78278742"} 2020/09/02 19:55:56 RPC.handle(id: 86a81ba2-dd12-4d1a-a873-8086b8f42652, method: subscribe, params: [96d1f1a8-2d1a-4f2e-ac3c-950f78278742 6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D 535d3bf6-edb8-4115-93d4-0a005185cd11]) 2020/09/02 19:55:56 RPC.handle(id: 86a81ba2-dd12-4d1a-a873-8086b8f42652, time: 0.000049s) ERROR {"status":202,"code":5002002,"description":"peer 6314d731-8052-4456-8183-cea0791ddadb%3AQXJ1biBEaHlhbmk%3D closed in 96d1f1a8-2d1a-4f2e-ac3c-950f78278742"}

Were you able to solve the issue?

cedricfung commented 4 years ago

To run the client and server in local, please do this modification in index.js

   const configuration = {
-    iceServers: [{
-      urls: TURNSERVER,
-      username: "webrtc",
-      credential: "turnpassword"
-    }],
-    iceTransportPolicy: 'relay',
+    iceTransportPolicy: 'all',
streaps commented 4 years ago

it's still not working for me.

I wonder if it has to do with the non-public IP that kraken is using. Is there a way to configure/set the public IP?

cedricfung commented 4 years ago

Maybe change the interface name in the configuration? I'm not familiar with container, maybe you could try something without container at first?

streaps commented 4 years ago

The interface name is correct (eth0). I just tested it without a container and it seems to work fine. I guess all it needs to work inside a container is a configuration option to set the IP address.

I'm running a webrtc proxy for Mumble and it works fine insider a container with NAT. https://github.com/Johni0702/mumble-web-proxy#firewalls-or-nat

cedricfung commented 4 years ago

Please try the new configuration.

streaps commented 4 years ago

looks good :). no errors in the log and audio works between mobile and desktop browser.