Documentation
¶
Overview ¶
P2P 示例:本地内存信令 / tunnel gateway 全链路 / dev coturn 验证。
用法:
# 1) 本地快速验证(无需 gateway,内存信令) go run ./core/p2p/example/main.go -mode=local # 2) 单进程全链路(gateway + 双 agent + P2P 拨号 + stream) go run ./core/p2p/example/main.go -mode=all # 3) 分终端运行(模拟两台机器) go run ./core/p2p/example/main.go -mode=gateway go run ./core/p2p/example/main.go -mode=peer -peer-id=node-b go run ./core/p2p/example/main.go -mode=peer -peer-id=node-a -dial-to=node-b # 4) 经 dev coturn STUN/TURN 验证(需外网) go run ./core/p2p/example/main.go -mode=dev
Click to show internal directories.
Click to hide internal directories.