chezmoi net
1.0.0
这是通过 Web Socket 的双向 JsonRPC2 实现。 chatclient 包下提供了最基本的示例。您可以通过以下方式运行该示例。
go run cmd/server/server.go
go run cmd/client/client.go
go run cmd/client/client.go -join
// Use the client package register service functions
client.RegisterService(chatClient, chatClient.Client, chatClient.target)
// use client instance to get rpcClient
rpcClient := chatClient.Client.GetRpcClientForService(*chatClient)
sname := chatClient.Client.GetServiceName(*chatClient)
if rpcClient != nil {
var reply string
rpcClient.Call(sname+".OnMessage", Message{Source: *chatClient.Client.Id, Message: message}, &reply)
}
https://github.com/nmorenor/chezmoi
https://nmorenor.com