lesismal / arpc

More effective network communication, two-way calling, notify and broadcast supported.
MIT License
960 stars 75 forks source link

大佬你好,请教下在fiber里怎么集成arpc做webchat #69

Open hiifong opened 2 weeks ago

lesismal commented 2 weeks ago

感谢关注!

刚提交了下, 增加了fiber的转换, 可以参考下这里: https://github.com/lesismal/arpc/blob/master/examples/protocols/websocket/server/server.go

这里的 "/ws" 路由用于 arpc 的 method/router, 如果fiber还有其他websocket, 可以自己设定不同的路由

client代码在同级目录下, arpc go和js都有: https://github.com/lesismal/arpc/tree/master/examples/protocols/websocket client dialer的路由需要与server的路由相同: https://github.com/lesismal/arpc/blob/master/examples/protocols/websocket/client/client.go#L20 https://github.com/lesismal/arpc/blob/master/examples/protocols/websocket/jsclient/hello.html#L11

hiifong commented 2 weeks ago

非常感谢大佬

lesismal commented 2 weeks ago

不客气, 欢迎使用!