{"id":34230373,"url":"https://github.com/tukangremot/gows","last_synced_at":"2026-03-13T19:06:33.620Z","repository":{"id":223117402,"uuid":"758484510","full_name":"tukangremot/gows","owner":"tukangremot","description":"Websocket server that supports multipurpose","archived":false,"fork":false,"pushed_at":"2024-04-19T12:35:37.000Z","size":14,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T15:17:54.889Z","etag":null,"topics":["chat-engine","chat-server","go","go-package","golang","golang-package","realtime-chat","realtime-messaging","websocket","websocket-chat","websocket-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tukangremot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-16T12:27:39.000Z","updated_at":"2024-03-01T08:06:33.000Z","dependencies_parsed_at":"2024-04-19T14:00:11.265Z","dependency_job_id":null,"html_url":"https://github.com/tukangremot/gows","commit_stats":null,"previous_names":["tukangremot/gochat","tukangremot/gows"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tukangremot/gows","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tukangremot%2Fgows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tukangremot%2Fgows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tukangremot%2Fgows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tukangremot%2Fgows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tukangremot","download_url":"https://codeload.github.com/tukangremot/gows/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tukangremot%2Fgows/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30472989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T17:15:31.527Z","status":"ssl_error","status_checked_at":"2026-03-13T17:15:22.394Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chat-engine","chat-server","go","go-package","golang","golang-package","realtime-chat","realtime-messaging","websocket","websocket-chat","websocket-server"],"created_at":"2025-12-16T01:02:40.383Z","updated_at":"2026-03-13T19:06:33.613Z","avatar_url":"https://github.com/tukangremot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoWS\n\n## Usage\n\n### Example\n\n#### Simple\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/tukangremot/gows\"\n)\n\nvar addr = flag.String(\"addr\", \":8080\", \"http service address\")\n\nvar upgrader = websocket.Upgrader{\n\tReadBufferSize:  4096,\n\tWriteBufferSize: 4096,\n\tCheckOrigin: func(r *http.Request) bool {\n\t\treturn true\n\t},\n}\n\nfunc serveWs(w http.ResponseWriter, r *http.Request) {\n\tconn, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tclient := gows.NewClient(conn)\n\n\tgo client.WritePump()\n\tgo client.ReadPump()\n\n\t// read message\n\tfor {\n\t\tselect {\n\t\tcase message := \u003c-client.ReadMessage():\n\t\t\t// do something whene receive a message\n\t\t\tmessageStr := string(message)\n\t\t\tfmt.Println(messageStr)\n\n\t\t\t// send message to client\n\t\t\tclient.SendMessage(message)\n\t\tcase err := \u003c-client.GetError():\n\t\t\tif err == gows.ErrClientDisconnected {\n\t\t\t\t// do something if the client disconnects\n\t\t\t\tfmt.Println(err)\n\t\t\t} else {\n\t\t\t\t//so something if something else goes wrong\n\t\t\t\tfmt.Println(err)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/ws\", serveWs)\n\n\thttpServer := \u0026http.Server{\n\t\tAddr:              *addr,\n\t\tReadHeaderTimeout: 3 * time.Second,\n\t}\n\n\terr := httpServer.ListenAndServe()\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe: \", err)\n\t}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftukangremot%2Fgows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftukangremot%2Fgows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftukangremot%2Fgows/lists"}