{"id":40983412,"url":"https://github.com/seehuhn/go-websocket","last_synced_at":"2026-01-22T07:19:52.531Z","repository":{"id":64304180,"uuid":"206665950","full_name":"seehuhn/go-websocket","owner":"seehuhn","description":"A GPL-licensed websocket server, written in Go.","archived":false,"fork":false,"pushed_at":"2025-11-11T19:59:29.000Z","size":287,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T21:22:56.302Z","etag":null,"topics":["go","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seehuhn.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-05T22:13:58.000Z","updated_at":"2025-11-11T19:59:33.000Z","dependencies_parsed_at":"2023-02-17T05:15:19.212Z","dependency_job_id":null,"html_url":"https://github.com/seehuhn/go-websocket","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/seehuhn/go-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehuhn%2Fgo-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehuhn%2Fgo-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehuhn%2Fgo-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehuhn%2Fgo-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seehuhn","download_url":"https://codeload.github.com/seehuhn/go-websocket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehuhn%2Fgo-websocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28658102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","websocket"],"created_at":"2026-01-22T07:19:51.911Z","updated_at":"2026-01-22T07:19:52.522Z","avatar_url":"https://github.com/seehuhn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Websocket\n=========\n\nWebsocket is a http handler for Go, which initiates websocket_\nconnections.\n\n.. _websocket: https://en.wikipedia.org/wiki/WebSocket\n\nCopyright (C) 2019  Jochen Voss\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nInstallation\n------------\n\nThis package can be installed using the ``go get`` command::\n\n  go get seehuhn.de/go/websocket\n\nUsage\n-----\n\nDocumentation is available via the package's online help, either on\ngodoc.org_ or on the command line::\n\n  go doc -all seehuhn.de/go/websocket\n\nFor demonstation, here is a simple echo server.  To install the handler\nat a given URL, use a ``websocket.Handler`` object::\n\n  func main() {\n\t  websocketHandler := \u0026websocket.Handler{\n\t\t  Handle: echo,\n\t  }\n\t  http.Handle(\"/\", websocketHandler)\n\t  log.Fatal(http.ListenAndServe(\":8080\", nil))\n  }\n\nThe function ``echo()`` will be called every time a client makes a\nconnection::\n\n  func echo(conn *websocket.Conn) {\n\t  defer conn.Close(websocket.StatusOK, \"\")\n\n\t  for {\n\t\t  tp, r, err := conn.ReceiveMessage()\n\t\t  if err != nil {\n\t\t\t  break\n\t\t  }\n\n\t\t  w, err := conn.SendMessage(tp)\n\t\t  if err != nil {\n\t\t\t  // We still need to read the complete message, so that the\n\t\t\t  // next read doesn't block.\n\t\t\t  io.Copy(io.Discard, r)\n\t\t\t  break\n\t\t  }\n\n\t\t  _, err = io.Copy(w, r)\n\t\t  if err != nil {\n\t\t\t  io.Copy(io.Discard, r)\n\t\t  }\n\n\t\t  w.Close()\n\t  }\n  }\n\n.. _godoc.org: https://godoc.org/seehuhn.de/go/websocket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseehuhn%2Fgo-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseehuhn%2Fgo-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseehuhn%2Fgo-websocket/lists"}