原生 ssh 增加 socks 代理功能

This commit is contained in:
dushixiang
2021-11-15 20:01:19 +08:00
parent 569a1ad763
commit 8759365f08
7 changed files with 145 additions and 31 deletions

View File

@ -229,7 +229,7 @@ func (opt *Tunnel) WriteInstructionAndFlush(instruction Instruction) error {
}
func (opt *Tunnel) WriteAndFlush(p []byte) (int, error) {
//fmt.Printf("-> %v\n", string(p))
fmt.Printf("-> %v\n", string(p))
nn, err := opt.writer.Write(p)
if err != nil {
return nn, err
@ -257,7 +257,7 @@ func (opt *Tunnel) Read() (p []byte, err error) {
}
buffer = buffer[0:read]
s := string(buffer)
//fmt.Printf("<- %v \n", s)
fmt.Printf("<- %v \n", s)
if s == "rate=44100,channels=2;" {
return make([]byte, 0), nil
}