{"id":36443545,"url":"https://github.com/bediger4000/udp-echo-server","last_synced_at":"2026-01-11T22:01:40.547Z","repository":{"id":125328901,"uuid":"116523462","full_name":"bediger4000/udp-echo-server","owner":"bediger4000","description":"Golang echo server, using UDP","archived":false,"fork":false,"pushed_at":"2022-02-20T19:02:50.000Z","size":4,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-21T17:05:55.327Z","etag":null,"topics":["echo-client","echo-server","golang","udp"],"latest_commit_sha":null,"homepage":null,"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/bediger4000.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,"publiccode":null,"codemeta":null}},"created_at":"2018-01-06T23:38:43.000Z","updated_at":"2022-11-03T06:52:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"da06723d-1772-4f9e-8753-a3b347c4f25b","html_url":"https://github.com/bediger4000/udp-echo-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bediger4000/udp-echo-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bediger4000%2Fudp-echo-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bediger4000%2Fudp-echo-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bediger4000%2Fudp-echo-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bediger4000%2Fudp-echo-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bediger4000","download_url":"https://codeload.github.com/bediger4000/udp-echo-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bediger4000%2Fudp-echo-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","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":["echo-client","echo-server","golang","udp"],"created_at":"2026-01-11T22:01:39.887Z","updated_at":"2026-01-11T22:01:40.538Z","avatar_url":"https://github.com/bediger4000.png","language":"Go","readme":"# Quick and dirty UDP-based echo server and client in Go\n\nToy UDP server and client in Go. I did this to acquaint myself\nwith Go's standard package `net`, specifically the UDP-related\nfunctions.\n\nBecause I learned as I wrote, here's a weird stylistic mismatch between how\nserver.go does UDP sockets, and how client.go does some \"general\" socket thing.\nTo reconcile this mismatch, I did client2.go with just UDP functions to match server.go.\n\nI also added a Python 3 client, because I have no where else to put it.\n\n### Echo protocol\n\nThe server listens for UDP packets on a particular port number.\nIt blocks on `net.ReadFromUDP()` method call.\n\nShould the server ever receive bytes, it prints out how many bytes\nit received from where, then writes that same number of bytes back\nto wherever it received them from.\n\nThe client creates a UDP connection to some IP (v4 or v6) or hostname\nand a port number, based on command line information. Then it writes\nbytes of a string, also from the command line, to the UDP connection.\nIt waits until some bytes come back to it, or an error occurs. Then it\nexists.\n\nSimple, and yet full of problems. No timeouts, no set number of bytes.\nClient or server could hang forever waiting for a packet that never arrives.\n\n## Building\n\n```sh\n$ go build server.go\n$ go build client.go\n$ go build client2.go\n```\n\nThe [python 3 client](client1.py) is interpreted and does not need \"building\".\n\n## Usage\n\nIn Window 1:\n\n    $ ./server :: 7890\n    Accepting a new packet\n\n\nIn Window 2:\n\n    $ ./client udp localhost 7890 'some string'\n\nOr:\n\n    $ ./client2 fe80::a11:96ff:fe7f:6d74 7890 'some string' [eth0]\n\nOr:\n\n    $ ./client1.py localhost 7890 'some string'\n\nThe final argument of `./client2` is optional. It's the name of the network interface to route the packets through.\nNote the contents of `net.UDPAddr`:\n\n    type UDPAddr struct {\n            IP   IP\n            Port int\n            Zone string // IPv6 scoped addressing zone\n    }\n\nThe Zone element is used for routing link-local addresses\n(fe80: prefix). The interface name works as the zone.\nCalled with a 4th argument, `client2` uses that argument\nas the \"zone\".\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbediger4000%2Fudp-echo-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbediger4000%2Fudp-echo-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbediger4000%2Fudp-echo-server/lists"}