{"id":37095199,"url":"https://github.com/taigrr/go-wireless","last_synced_at":"2026-01-14T11:44:04.409Z","repository":{"id":57649640,"uuid":"446585975","full_name":"taigrr/go-wireless","owner":"taigrr","description":"Small Go libraries for dealing with live wireless network configuration, monitoring and scanning using wpa_supplicant (via control socket) and iw (via libiw)","archived":false,"fork":true,"pushed_at":"2022-10-30T06:03:56.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-09T10:04:51.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"theojulienne/go-wireless","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taigrr.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-01-10T21:23:19.000Z","updated_at":"2022-01-10T21:52:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/taigrr/go-wireless","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/taigrr/go-wireless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fgo-wireless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fgo-wireless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fgo-wireless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fgo-wireless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taigrr","download_url":"https://codeload.github.com/taigrr/go-wireless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fgo-wireless/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419257,"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-14T11:44:03.744Z","updated_at":"2026-01-14T11:44:04.398Z","avatar_url":"https://github.com/taigrr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-wireless\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/theojulienne/go-wireless)](https://goreportcard.com/report/github.com/theojulienne/go-wireless) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/theojulienne/go-wireless) ![Go](https://github.com/theojulienne/go-wireless/workflows/Go/badge.svg)\n\nA way to interact with the Wireless interfaces on a Linux machine using WPA Supplicant.\n\n## Requirements\n\nRequires a running wpa_supplicant with control interface at `/var/run/wpa_supplicant` (which is usually \na symlink to `/run/wpa_supplicant`).  This requires the config file to contain the line:\n\n```\nctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel\n```\n\nOr for the `wpa_supplicant` instance to be running with the `-O /run/wpa_supplicant` argument.\n\nYou will probably also need to be running as root unless you are in the specified group (`wheel` in the above example).\n\n# Usage\n\nExamples of the usage can be found in the `cmd` directory as standalone commands.\n\nGet a list of wifi cards attached:\n\n```golang\nifaces := wireless.Interfaces()\n```\n\nFrom there you can use the client:\n\n```golang\nwc, err := wireless.NewClient(\"wlan0\")\ndefer wc.Close()\n```\n\nGet a list of APs that are in range:\n\n```golang\naps, err := wc.Scan()\nfmt.Println(aps, err)\nap, ok := wireless.APs(aps).FindBySSID(\"CIA Predator Drone 237A\")\n```\n\nGet a list of known networks (**note:** the password cannot be retrieved so are not populated):\n\n```golang\nnets, err := wc.Networks()\nfmt.Println(nets, err)\n```\n\nConnect to networks:\n\n```golang\nnet := NewNetwork(\"FBI Surveillance Van #4\", \"secretpass\")\nnet, err := wc.Connect(net)\n```\n\nDisable networks:\n\n```golang\nnets, err:= wc.Networks()\nnet, err := net, ok := wireless.Networks(nets).FindBySSID(\"FBI Surveillance Van #4\")\nnet.Disable(true)\nnet, err := wc.UpdateNetwork(net)\n```\n\nSubscribe to events:\n\n```golang\nconn, _ := wireless.Dial(\"wlp2s0\")\nsub := conn.Subscribe(wireless.EventConnected, wireless.EventAuthReject, wireless.EventDisconnected)\n\nev := \u003c-sub.Next()\nswitch ev.Name {\n\tcase wireless.EventConnected:\n\t\tfmt.Println(ev.Arguments)\n\tcase wireless.EventAuthReject:\n\t\tfmt.Println(ev.Arguments)\n\tcase wireless.EventDisconnected:\n\t\tfmt.Println(ev.Arguments)\n}\n```\n\nCheck the status of the connection:\n\n```golang\nst, err := wc.Status()\nfmt.Printf(\"%+v\\n\", st)\n```\n\n\n## API\n\nThere is an API that can be used with [gin](https://github.com/gin-gonic/gin):\n\n```golang\nr := gin.Default()\napi.SetupRoutes(r)\nr,Serve(\":8080\")\n```\n\n## Endpoints\n\n- [x] `GET /interfaces`\n- [ ] `GET /interfaces/:iface`\n- [ ] `PUT /interfaces/:iface`\n- [x] `GET /interfaces/:iface/aps`\n- [x] `GET /interfaces/:iface/networks`\n- [ ] `POST /interfaces/:iface/networks`\n- [ ] `PUT /interfaces/:iface/networks/:id_or_idstr`\n- [ ] `GET /interfaces/:iface/networks/:id_or_idstr`\n- [ ] `DELETE /interfaces/:iface/networks/:id_or_idstr`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaigrr%2Fgo-wireless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaigrr%2Fgo-wireless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaigrr%2Fgo-wireless/lists"}