{"id":22369871,"url":"https://github.com/zeozeozeo/jolta","last_synced_at":"2026-05-19T04:11:20.642Z","repository":{"id":64299488,"uuid":"569286114","full_name":"zeozeozeo/jolta","owner":"zeozeozeo","description":"An easy-to-use event-based networking library based on KCP and Smux for Go.","archived":false,"fork":false,"pushed_at":"2022-11-22T13:58:00.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T19:39:59.663Z","etag":null,"topics":["easy-to-use","event-based","event-driven","golang","kcp","networking","smux"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/zeozeozeo/jolta","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeozeozeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-22T13:45:34.000Z","updated_at":"2024-11-09T18:16:03.000Z","dependencies_parsed_at":"2023-01-15T09:15:28.384Z","dependency_job_id":null,"html_url":"https://github.com/zeozeozeo/jolta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fjolta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fjolta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fjolta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeozeozeo%2Fjolta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeozeozeo","download_url":"https://codeload.github.com/zeozeozeo/jolta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245690224,"owners_count":20656550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["easy-to-use","event-based","event-driven","golang","kcp","networking","smux"],"created_at":"2024-12-04T19:29:31.643Z","updated_at":"2026-05-19T04:11:15.606Z","avatar_url":"https://github.com/zeozeozeo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jolta\n[![Go Report Card](https://goreportcard.com/badge/github.com/zeozeozeo/jolta)](https://goreportcard.com/report/github.com/zeozeozeo/jolta)\n![License](https://img.shields.io/github/license/zeozeozeo/jolta)\n[![Documentation](https://pkg.go.dev/badge/github.com/zeozeozeo/jolta)](https://pkg.go.dev/github.com/zeozeozeo/jolta)\n\nThis is an event-based networking library for Go, based on [KCP](https://github.com/xtaci/kcp-go) and [Smux](https://github.com/xtaci/smux).\n\n# Features\n\n-   Secure: all of the data is encrypted by default, and there's no way to disable it.\n-   Small latency: the KCP protocol is [designed for small latencies](https://raw.githubusercontent.com/skywind3000/kcp/master/images/spatialos-50.png).\n-   Small: the entire library is ~650 lines of code.\n\n# Examples\n\n## (Server) Start a server\n\n```go\npackage main\n\nimport \"github.com/zeozeozeo/jolta\"\n\nfunc main() {\n    // server address, password, salt\n    server := jolta.NewServer(\"127.0.0.1:7145\", []byte(\"test password\"), []byte(\"test salt\"))\n\n    // listen (this is blocking)\n\tif err := server.Listen(); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n## (Client) Connect to a server\n\n```go\npackage main\n\nimport \"github.com/zeozeozeo/jolta\"\n\nfunc main() {\n    // server address, password and salt\n    // of the server you want to connect to\n    client := jolta.NewClient(\"127.0.0.1:7145\", []byte(\"test password\"), []byte(\"test salt\"))\n\n    // connect to the server (this is blocking)\n    if err := client.Connect(); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n## (Client) Send and recieve messages to/from other clients\n\n```go\nfunc main() {\n    // client := jolta.NewClient(...)\n\n    client.OnConnect(func(client *jolta.Client) {\n        // send a message to all connected\n        // clients, the event name can be\n        // any string\n\t\tclient.SendAll(\"any event name\", []byte(\"hello from client!\"))\n\n        // get all clients connected to\n        // the server\n        clients, err := client.GetClients()\n        if err != nil || len(clients) == 0 {\n            return\n        }\n\n        // send a message to some client\n        // (clients are represented with\n        // ID's, 1 being the client that\n        // connected first)\n        client.SendTo(\"any event name\", clients[0], []byte(\"hi client!\"))\n\t})\n\n    // recieve messages from other clients\n\tclient.On(\"any event name\", func(client *jolta.Client, senderId uint32, data []byte) {\n\t\t// do anything you want...\n        fmt.Printf(\"client %d says: %s\\n\", senderId, string(data))\n\t})\n\n    // client.Connect()...\n}\n```\n\n## See more examples in [internal/examples](https://github.com/zeozeozeo/jolta/tree/main/internal/examples)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeozeozeo%2Fjolta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeozeozeo%2Fjolta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeozeozeo%2Fjolta/lists"}