628 sao GitHub và vẫn tăng — kataras/neffos là dự án Go mà TopGit đang theo dõi trên nền tảng. A modern, fast and scalable websocket framework with elegant API written in Go
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Neffos is a cross-platform real-time framework with an expressive, elegant API written in Go. Neffos eases common tasks needed in real-time backend and frontend applications, such as:
Scale-out using redis or nats*, with StackExchangeCloser to release it on shutdown and NSConn.Broadcast for a same-server send
Adaptive request upgradation and server dialing
Three backends: gorilla, gobwas, coder
Acknowledgements
Namespaces
Rooms
Broadcast
Event-Driven architecture
Request-Response architecture
Error Awareness
Asynchronous Broadcast
Heartbeat, close status codes and a message size limit
Graceful shutdown
Timeouts
Encoding
Reconnection (neffos.js)
Modern neffos API client for Browsers, Node.js* and Go
Installation
Go 1.27 or later is required.
go get github.com/kataras/neffos@latest
API outline
One Conn per websocket, one NSConn per namespace it connects to, one Room per room it joins. Server and client sides share the same types and methods.
import (
// [...]
"github.com/kataras/neffos"
"github.com/kataras/neffos/gorilla"
)
func runServer() {
events := make(neffos.Namespaces)
events.On("/v1", "workday", func(ns *neffos.NSConn, msg neffos.Message) error {
date := string(msg.Body)
t, err := time.Parse("01-02-2006", date)
if err != nil {
// Return the parse error back to the client.
return err
}
if t.Weekday() == time.Saturday || t.Weekday() == time.Sunday {
// Fire the "notify" client event instead of replying.
return ns.Send("notify", []byte("day off"))
}
// Reply back to the client.
responseText := fmt.Sprintf("it is %s, do your job.", t.Weekday())
return neffos.Reply([]byte(responseText))
})
// WithTimeout adds a read timeout and a heartbeat on top of the namespaces.
websocketServer := neffos.New(gorilla.DefaultUpgrader, neffos.WithTimeout{
ReadTimeout: 60 * time.Second,
PingInterval: 20 * time.Second,
Namespaces: events,
})
router := http.NewServeMux()
router.Handle("/", websocketServer)
log.Println("Serving websockets on localhost:8080")
log.Fatal(http.ListenAndServe(":8080", router))
}
Go Client
func runClient() {
ctx := context.TODO()
events := make(neffos.Namespaces)
events.On("/v1", "notify", func(c *neffos.NSConn, msg neffos.Message) error {
log.Printf("Server says: %s\n", string(msg.Body))
return nil
})
// Connect to the server.
client, err := neffos.Dial(ctx,
gorilla.DefaultDialer,
"ws://localhost:8080",
events)
if err != nil {
panic(err)
}
// Connect to a namespace.
c, err := client.Connect(ctx, "/v1")
if err != nil {
panic(err)
}
fmt.Println("Please specify a date of format: mm-dd-yyyy")
for {
fmt.Print(">> ")
var date string
fmt.Scanf("%s", &date)
// Send to the server and wait for a reply to this message.
response, err := c.Ask(ctx, "workday", []byte(date))
if err != nil {
if neffos.IsCloseError(err) {
// Check if the error is a close signal,
// or make use of the `<- client.NotifyClose`
// read-only channel instead.
break
}
// >> 13-29-2019
// error received: parsing time "13-29-2019": month out of range
fmt.Printf("error received: %v\n", err)
continue
}
// >> 06-29-2019
// it is a day off!
//
// >> 06-24-2019
// it is Monday, do your job.
fmt.Println(string(response.Body))
}
}
The wiki covers every feature with a page of its own, from the first echo server to scaling out over Redis or NATS.
For detailed technical documentation, head over to pkg.go.dev. For executable code, visit the _examples directory.
What's new
See HISTORY.md for the full changelog. If you are upgrading from v0.0.24 or earlier, read the migration guide on the wiki: Migrating-to-v0.0.25.
Contributing
We'd love to see your contribution to the neffos real-time framework! For more information about contributing to the neffos project please check the CONTRIBUTING.md file.
neffos-contrib github organisation for more programming languages support, please invite yourself.
Security Vulnerabilities
If you discover a security vulnerability within neffos, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
License
The word "neffos" has a greek origin and it is translated to "cloud" in English dictionary.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/kataras/neffos là nguồn chính thức.
kataras/neffos có bao nhiêu sao?
kataras/neffos có 628 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/kataras/neffos. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
kataras/neffos có những chủ đề gì?
GitHub topics của kataras/neffos: "go", "golang", "iris", "neffos", "websocket". TopGit xếp repo vào nhóm Backend.
kataras/neffos có trang demo không?
Dự án có trang chủ ở https://github.com/kataras/neffos/wiki. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
kataras/neffos còn đang phát triển không?
Commit gần nhất trên kataras/neffos là 19 ngày trước (theo timestamp GitHub). Repo có 52 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
kataras/neffos dùng license gì?
kataras/neffos phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
kataras/neffos viết bằng ngôn ngữ gì?
kataras/neffos chủ yếu viết bằng Go. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về neffos?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về neffos.