{"id":19858494,"url":"https://github.com/matjam/telnet","last_synced_at":"2025-10-09T18:34:29.214Z","repository":{"id":169264110,"uuid":"645161220","full_name":"matjam/telnet","owner":"matjam","description":"GO telnet server/client package","archived":false,"fork":false,"pushed_at":"2023-05-25T04:41:59.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T23:57:43.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matjam.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T03:59:51.000Z","updated_at":"2024-04-22T17:24:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5e32269-6004-4bf2-8a8f-a2e1b16e5374","html_url":"https://github.com/matjam/telnet","commit_stats":null,"previous_names":["matjam/telnet"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/matjam/telnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Ftelnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Ftelnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Ftelnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Ftelnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matjam","download_url":"https://codeload.github.com/matjam/telnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Ftelnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001916,"owners_count":26083226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-11-12T14:23:43.875Z","updated_at":"2025-10-09T18:34:29.197Z","avatar_url":"https://github.com/matjam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Package telnet\n\nThe [`telnet` package](http://godoc.org/github.com/matjam/telnet) provides basic\ntelnet client and server implementations for Go, including handling of IACs and\nextensible telnet option negotiation.\n\nCurrently both the basic client and server are implemented, as well as a NAWS\nclient/server handler as a working example. Additional handlers may be added to\nthe core library over time (feel free to submit a PR if you've written one you'd\nlike to see added!)\n\n## Usage\n\nRunning a server:\n\n```go\nsvr := telnet.NewServer(\":9999\", telnet.HandleFunc(func(c *telnet.Connection){\n\tlog.Printf(\"Connection received: %s\", c.RemoteAddr())\n\tc.Write([]byte(\"Hello world!\\r\\n\"))\n\tc.Close()\n}))\nsvr.ListenAndServe()\n```\n\nThe server API is modeled after the `net/http` API, so it should be easy to get\nyour bearings; of course, telnet and HTTP are very different beasts, so the\nsimilarities are somewhat limited. The server listens on a TCP address for new\nconnections. Whenever a new connection is received, the connection handler is\ncalled with the connection object. This object is a wrapper for the underlying\nTCP connection, which aims to transparently handle IAC. There is a slightly\nmore complex example located in the `example` package.\n\nRunning a client is pretty simple:\n\n```go\nconn, err := telnet.Dial(\"127.0.0.1:9999\")\n```\n\nThis is really straightforward - dial out, get a telnet connection handler back.\nAgain, this handles IAC transparently, and like the Server, can take a list of\noptional IAC handlers. Bear in mind that some handlers - for example, the\nincluded NAWS handler - use different Option functions to register them with a\nclient versus a server; this is because they may behave differently at each end.\nSee the documentation for the options for more details.\n\n## Linereader\n\nA sub-package, `linereader`, exposes a simple reader intended to be run in a\nGoroutine, which consumes lines from an `io.Reader` and sends them over a\nchannel for asynchronous handling.\n\n# Thanks\n\nThis package was forked from `github.com/aprice/telnet`. Thanks to aprice for\nthe initial implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatjam%2Ftelnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatjam%2Ftelnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatjam%2Ftelnet/lists"}