reiver / go-telnet

Package telnet provides TELNET and TELNETS client and server implementations, for the Go programming language, in a style similar to the "net/http" library that is part of the Go standard library, including support for "middleware"; TELNETS is secure TELNET, with the TELNET protocol over a secured TLS (or SSL) connection.
https://godoc.org/github.com/reiver/go-telnet
MIT License
267 stars 83 forks source link

Not only connecting Telnet Server port, connecting other ports #21

Open gozeloglu opened 3 years ago

gozeloglu commented 3 years ago

I try to check Telnet server is running or not in my project. I am testing on Docker image. I used DialTo() function with passing address like 127.0.0.1:23. It seems perfect when I check as just below:

_, err := telnet.DialTo("127.0.0.1:23")
if err != nil {
    log.Fatalln("error while connecting Telnet server:", err)
}

fmt.Println("Telnet server is running...")

Program prints out Telnet server is running.... Then, I tried another port, but not Telnet server, Redis's port. I changed the address with 127.0.0.1:6378. And, it still works. I think this is not appropriate way to implement this client. I just want to talk with Telnet server and its ports, not other servers and their ports. Is there any way to solve that problem with this package? If there is not, I'd like to try add this feature with your helps.