Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egonelbre/telnet
basic telnet protocol implementation for Go
https://github.com/egonelbre/telnet
Last synced: 8 days ago
JSON representation
basic telnet protocol implementation for Go
- Host: GitHub
- URL: https://github.com/egonelbre/telnet
- Owner: egonelbre
- License: mit
- Created: 2016-01-17T11:53:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-17T13:13:35.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T16:33:59.382Z (5 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Telnet implements basic support for telnet protocol.
WARNING: This is a work in progress, so the API can change at any point.
If you want stability, vendor it into your own repository.Example how to use:
``` go
package mainimport (
"fmt""github.com/egonelbre/telnet"
)func main() {
fmt.Printf("Server started on :8000\n")
telnet.ListenAndServe(":8000", handle)
}func handle(conn *telnet.Conn) {
conn.Print("\n\n# HELLO WORLD #\n\n")
conn.Print("What's your nick? ")
nick := <-conn.Linesconn.Printf("Welcome %s!\n", nick)
for line := range conn.Lines {
fmt.Printf("[%s] %s\n", nick, line)
}
}
```