You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the best way to log IPs that connect to the telnet server. I've experimented with various ways but have been unable to do it so far. Here's a simple example.
package main
import (
"github.com/reiver/go-telnet"
"log"
)
var RBTHandler telnet.Handler = internalRBTHandler{}
type internalRBTHandler struct{}
func (handler internalRBTHandler) ServeTELNET(ctx telnet.Context, w telnet.Writer, r telnet.Reader) {
// How do I log the remote ip here?
log.Printf("%v\n", ctx)
}
What is the best way to log IPs that connect to the telnet server. I've experimented with various ways but have been unable to do it so far. Here's a simple example.
package main
import (
"github.com/reiver/go-telnet"
"log"
)
var RBTHandler telnet.Handler = internalRBTHandler{}
type internalRBTHandler struct{}
func (handler internalRBTHandler) ServeTELNET(ctx telnet.Context, w telnet.Writer, r telnet.Reader) {
// How do I log the remote ip here?
log.Printf("%v\n", ctx)
}
func main() {
var handler telnet.Handler = RBTHandler
//var logger telnet.Logger
}
The text was updated successfully, but these errors were encountered: