From 35f5f2d12ccd7351ac0e25e20272c59cd4c485d3 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Mon, 12 Oct 2015 20:00:27 +0800 Subject: [PATCH] printable for userpass --- socks5.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/socks5.go b/socks5.go index 9b8d314..8a32b59 100644 --- a/socks5.go +++ b/socks5.go @@ -176,6 +176,11 @@ func (req *UserPassRequest) Write(w io.Writer) error { return err } +func (req *UserPassRequest) String() string { + return fmt.Sprintf("%d %s:%s", + req.Version, req.Username, req.Password) +} + /* Username/Password authentication response +----+--------+ @@ -219,6 +224,11 @@ func (res *UserPassResponse) Write(w io.Writer) error { return err } +func (res *UserPassResponse) String() string { + return fmt.Sprintf("%d %d", + res.Version, res.Status) +} + type Addr struct { Type uint8 Host string