Versions in this module Expand all Collapse all v0 v0.0.2 Jun 14, 2026 Changes in this version + const CR + const DO + const DONT + const ECHO + const IAC + const LINEMODE + const NAWS + const NL + const SB + const SE + const SGA + const WILL + const WONT + func DialAndCall(srvAddr string, caller Caller) error + func DialAndCallTLS(srvAddr string, caller Caller, tlsConfig *tls.Config) error + func ListenAndServe(addr string, handler HandlerFunc) error + func ListenAndServeTLS(addr string, certFile string, keyFile string, handler HandlerFunc) error + func LongWrite(w io.Writer, p []byte) (int64, error) + func ReadLine(reader io.Reader) (string, error) + func Serve(listener net.Listener, handler HandlerFunc) error + func WriteCommand(writer io.Writer, command byte, option byte, action byte) (n int, err error) + func WriteLine(writer io.Writer, text ...string) error + type Caller interface + CallTELNET func(context.Context, io.Writer, io.Reader) + var StandardCaller Caller = internalStandardCaller{} + type CallerFunc func(context.Context, io.Writer, io.Reader) + var EchoCaller CallerFunc = func(ctx context.Context, w io.Writer, r io.Reader) { ... } + func (f CallerFunc) CallTELNET(ctx context.Context, w io.Writer, r io.Reader) + type Client struct + Caller Caller + Logger *slog.Logger + func NewClient(caller Caller, logger *slog.Logger) *Client + func (client *Client) Call(conn *Conn) error + type Conn struct + func Dial(protocol, addr string) (*Conn, error) + func DialTLS(protocol, addr string, tlsConfig *tls.Config) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) Read(p []byte) (int, error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) Write(p []byte) (int, error) + type HandlerFunc func(server *Session) + var EchoHandler HandlerFunc = func(session *Session) { ... } + func (f HandlerFunc) ServeTELNET(session *Session) + type Server struct + Addr string + ConnCallback func(ctx context.Context, conn net.Conn) net.Conn + ConnContext func(ctx context.Context, conn net.Conn) context.Context + Handler HandlerFunc + TLSConfig *tls.Config + Timeout time.Duration + func (server *Server) ListenAndServe() error + func (server *Server) ListenAndServeTLS(certFile string, keyFile string) error + func (server *Server) Serve(listener net.Listener) error + func (server *Server) SetLogger(logger *slog.Logger) + func (server *Server) Shutdown() error + type Session struct + func (r Session) ReadSubnegotiation() (*Subnegotiation, error) + func (s *Session) Context() context.Context + func (s *Session) GetWindowSize() (int, int) + func (s *Session) HasWindowSize() bool + func (s *Session) Read(data []byte) (n int, err error) + func (s *Session) ReadLine() (string, error) + func (s *Session) RequestWindowSize() error + func (s *Session) SetIsPTY(isPTY bool) + func (s *Session) Write(data []byte) (int, error) + func (s *Session) WriteCommand(command byte, option byte, action byte) (n int, err error) + func (s *Session) WriteLine(text ...string) error + type Subnegotiation struct + Option byte + Payload []byte