I’ve app that use Helia node(js-ipfs) before. My goal is to provide browser-to-browser connection between 2 Helia.
So I want use Kubo node with public IP(DNS also) as middlemanto obtain peerId of another Helia node, and then use STUN/TURN public servers to establish direct connection between two browser nodes.
Also I want to use circuit relay first if it’s possible for same purpose.
Unfortunately I’m unable to find some documents related to that. Is that described somewhere?
Please help me how to enable webRTC and circuit-relay on Kubo, that will be compatible with Helia.
Those 2 lines I’ve been added to my transport section in Kubo config:
I found your post because I had the same question. I have doubts that this can be accomplished with Kubo. (I am not sure at all)
So far it was never possible to use Kubo as a WebRTC-star or relay for browser nodes. Kubo doesn’t speak WebRTC at all. You always needed a dedicated (and centralized) WebRTC-star service node. As far as I remember, you could use it as Websocket relay but this had to be done with wss (e.g. ssl via nginx proxy) instead of ws (in case it is not running on the local machine).I I thought, I had this working last year, but for some reason either something changed with Kubo or Helia or something else was breaking inbetween. So probably Helia isn’t doing the WebRTC-star anymore as js-ipfs was doing it before. (only an assumption)
With the latest version of Kubo from yesterday v0.24.0 WebRTC-direct should be possible in case the WebRTC peer is not behind firewall or router as they write. (a mobile phone might work, but they are working on it). I guess kubo has released some tests here if you want to dig into it. Release v0.24.0 · ipfs/kubo · GitHub.
Your first question, your config cannot be correct, because WebRTC is not possible.
traditionally WebRTC and WebRTC-direct can be used only between browser peers and with Helia running on NodeJS.
As far as I understand, you still need a special relay service in order to accomplish what you want to do:
So as you can see, you touched the current front line of Helia/Kubo developments and those are the questions probably all are working on at the moment. As soon it is working, this will be amazing.
You can setup a dedicated public relay service as in the above examples until its working with Kubo. This might be the thing I am going to do now. I’ll keep you updated as in case or as soon as I have better information.
restarted Kubo with docker compose down && docker compose up -d
checked if Kubo now sees my webrtc-direct multi address by executing docker compose exec ipfs ipfs id (can take some moments). Kubo even lists the public IP of my router. (not sure if thats okey?!)
anyhow, I took my 127.0.0.1 webrtc-direct MultiAddress /ip4/127.0.0.1/udp/4004/webrtc-direct/certhash/xyzblablabla/p2p/12DblablablaNodeId