最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to use a Gun Server as a relay only? - Stack Overflow

programmeradmin0浏览0评论

Is there a way to setup the GUN-server as a relay only? In other words, is there a way to ensure data is shared peer-to-peer only? The server only acts a signal (STUN like) server. In the few tests I've done I can't seem to see the data go P2P, and seems to only funnel through the gun-server.

I want to make sure the server has no client DB data on it. Obviously, connection info and possibly DB names would be there.

Thank you.

Is there a way to setup the GUN-server as a relay only? In other words, is there a way to ensure data is shared peer-to-peer only? The server only acts a signal (STUN like) server. In the few tests I've done I can't seem to see the data go P2P, and seems to only funnel through the gun-server.

I want to make sure the server has no client DB data on it. Obviously, connection info and possibly DB names would be there.

Thank you.

Share Improve this question edited Aug 19, 2018 at 22:35 Jbjet777 asked Aug 19, 2018 at 2:29 Jbjet777Jbjet777 611 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

@Jbjet777 great question!

You can drop in lib/webrtc into your browser app as an extension to get direct P2P messaging if WebRTC works.

By default GUN still relays via the relay peer to ensure reliability, as WebRTC historically has been very unreliable (although we do hope this lib/webrtc adapter is more reliable than other frameworks).

That said, it is possible to configure the setup you want you can manually call gun.back('opt.peers')[relay_peer_url].wire.close() (make sure calling this is safe, add if-checks and stuff) after your WebRTC sessions have been established.

Please hit up the chatroom if you want further help on doing this.

Also note, why do you want the relay peer to not help store/sync data? Is it perhaps because you want to keep the data private? That is possible to do with our SEA security layer which can do end-to-end encryption. Just in case this makes things easier for you!

发布评论

评论列表(0)

  1. 暂无评论