{"id":37104960,"url":"https://github.com/3mdeb/socketio","last_synced_at":"2026-01-14T12:40:21.792Z","repository":{"id":57498069,"uuid":"210795254","full_name":"3mdeb/socketio","owner":"3mdeb","description":"A copy of googollee/go-socket.io renamed with defects fixed and updated to 2.0.3 of socket.io","archived":false,"fork":true,"pushed_at":"2020-12-01T15:15:33.000Z","size":683,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T04:58:44.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"pschlump/socketio","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3mdeb.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":"2019-09-25T08:33:38.000Z","updated_at":"2022-12-20T13:35:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/3mdeb/socketio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/3mdeb/socketio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mdeb%2Fsocketio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mdeb%2Fsocketio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mdeb%2Fsocketio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mdeb%2Fsocketio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3mdeb","download_url":"https://codeload.github.com/3mdeb/socketio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3mdeb%2Fsocketio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2026-01-14T12:40:21.212Z","updated_at":"2026-01-14T12:40:21.779Z","avatar_url":"https://github.com/3mdeb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# socketio\n\nA copy of github.com/googollee/go-socket.io renamed with defects fixed and updated to 1.4.5 of socket.io.\nAlso works with 1.7.4 and 2.0.3 of Socket.IO client Javascript.\n\nsocketio is an implementation of [socket.io](http://socket.io) in Go (golang).\nThis provides the ability to perform real time communication from a browser\nto a server and back.  Content can be pushed from the server out to\nthe browser.\n\nIt is compatible with the 1.4.5 version of socket.io in Node.js, and supports room and namespace.\nThis version will be updated on a regular basis with the latest version of socket.io.\n\n## Install\n\nInstall the package with:\n\n```bash\n\tgo get github.com/mlsquires/socketio\n\tgo get github.com/pschlump/godebug\n\tgo get github.com/pschlump/MiscLib\n```\n\nImport it with:\n\n```go\n\timport \"github.com/mlsquires/socketio\"\n```\n\n## Example\n\nPlease check the ./examples/chat directory for more comprehensive examples.\n\n```go\n\tpackage main\n\n\t//\n\t// Command line arguments can be used to set the IP address that is listened to and the port.\n\t//\n\t// $ ./chat --port=8080 --host=127.0.0.1\n\t//\n\t// Bring up a pair of browsers and chat between them.\n\t//\n\n\timport (\n\t\t\"flag\"\n\t\t\"fmt\"\n\t\t\"log\"\n\t\t\"net/http\"\n\t\t\"os\"\n\n\t\t\"github.com/pschlump/MiscLib\"\n\t\t\"github.com/pschlump/godebug\"\n\t\t\"github.com/mlsquires/socketio\"\n\t)\n\n\tvar Port = flag.String(\"port\", \"9000\", \"Port to listen to\")                           // 0\n\tvar HostIP = flag.String(\"host\", \"localhost\", \"Host name or IP address to listen on\") // 1\n\tvar Dir = flag.String(\"dir\", \"./asset\", \"Direcotry where files are served from\")      // 1\n\tfunc init() {\n\t\tflag.StringVar(Port, \"P\", \"9000\", \"Port to listen to\")                           // 0\n\t\tflag.StringVar(HostIP, \"H\", \"localhost\", \"Host name or IP address to listen on\") // 1\n\t\tflag.StringVar(Dir, \"d\", \"./asset\", \"Direcotry where files are served from\")     // 1\n\t}\n\n\tfunc main() {\n\n\t\tflag.Parse()\n\t\tfns := flag.Args()\n\n\t\tif len(fns) != 0 {\n\t\t\tfmt.Printf(\"Usage: Invalid arguments supplied, %s\\n\", fns)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\tvar host_ip string = \"\"\n\t\tif *HostIP != \"localhost\" {\n\t\t\thost_ip = *HostIP\n\t\t}\n\n\t\t// Make certain that the command line parameters are handled correctly\n\t\t// fmt.Printf(\"host_ip \u003e%s\u003c HostIP \u003e%s\u003c Port \u003e%s\u003c\\n\", host_ip, *HostIP, *Port)\n\n\t\tserver, err := socketio.NewServer(nil)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tserver.On(\"connection\", func(so socketio.Socket) {\n\t\t\tfmt.Printf(\"%sa user connected%s, %s\\n\", MiscLib.ColorGreen, MiscLib.ColorReset, godebug.LF())\n\t\t\tso.Join(\"chat\")\n\t\t\tso.On(\"chat message\", func(msg string) {\n\t\t\t\tfmt.Printf(\"%schat message, %s%s, %s\\n\", MiscLib.ColorGreen, msg, MiscLib.ColorReset, godebug.LF())\n\t\t\t\tso.BroadcastTo(\"chat\", \"chat message\", msg)\n\t\t\t})\n\t\t\tso.On(\"disconnect\", func() {\n\t\t\t\tfmt.Printf(\"%suser disconnect%s, %s\\n\", MiscLib.ColorYellow, MiscLib.ColorReset, godebug.LF())\n\t\t\t})\n\t\t})\n\n\t\tserver.On(\"error\", func(so socketio.Socket, err error) {\n\t\t\tfmt.Printf(\"Error: %s, %s\\n\", err, godebug.LF())\n\t\t})\n\n\t\thttp.Handle(\"/socket.io/\", server)\n\t\thttp.Handle(\"/\", http.FileServer(http.Dir(*Dir)))\n\t\tfmt.Printf(\"Serving on port %s, brows to http://localhost:%s/\\n\", *Port, *Port)\n\t\tlisten := fmt.Sprintf(\"%s:%s\", host_ip, *Port)\n\t\tlog.Fatal(http.ListenAndServe(listen, nil))\n\t}\n```\n\n## License\n\nThe 3-clause BSD License  - see LICENSE for more details\n\n## History\n\nThis code is from an original https://github.com/googollee/go-socket.io .  The following \nhave been made:\n\n1. Renamed the package so that the directory structure matches with the package name.\nSome outside tools depend on this.\n1. Included go-engine.io as a subdirectory.\n1. Fixed defect #68 - \"Not Thread Safe\".  All accesses to maps are synchronized.\n1. Documentation improvements.\n1. Updated to use the current version of socket.io (1.3.6)\n1. Provided a packed(uglified) version of the JavaScript scoket.io library. A non-uglified version is in the \nsame directory also.\n1. Original defect #95 - Crash occurs when too many arguments are passed - suggested fix used and tested.\n1. Fixed a set of continuous connect/disconnect problems\n1. #45 - incorrect usage - see correct usage in test/o45 - fixed.\n1. #47 - crashing on Windows - unable to reproduce with go 1.3.1 on windows 8.  Appears to be fixed by changes for #68.\n1. #83 - see example in test/o83 - fixed.\n1. #82 - see example in test/o82 - fixed.\n1. #52 - see example in test/o52 - fixed.\n1. #67 - see example in test/o67 - fixed.\n1. Identified the problem where a emit is sent from client to server and server seems to discard/ignore the emit.  This is caused by an invalid paramter and an ignored error message.  Code review for all discarded/ignored error messages in progress.\n\n## FAQ\n\n1. Why is this not a fork of the original?  A: I can't figure out how to make a fork and change the\nname of the package on github.com.   Since a variety of outside tools hurl over the \"-\" and \".io\" in\nthe directory name I just made a copy and started at the beginning.   My apologies to anybody\nthat feels offended by this approach.  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3mdeb%2Fsocketio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3mdeb%2Fsocketio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3mdeb%2Fsocketio/lists"}