1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
var (
    httpFwd ...
    tlsFwd ...
    sshFwd ...
)

for {
    buf := conn.Read
    n, ok:=httpFwd.Feed(buf)
    if ok {
        buf = buf[:n]
        break
    }
    tls.Feed()...
    ssh.Feed()...
}

io.Copy ...
桃子的碎碎念 桃子 编辑