新增http代理模式

This commit is contained in:
刘河
2018-12-01 02:38:29 +08:00
parent 86deb2025f
commit 4994476af1
6 changed files with 85 additions and 25 deletions

View File

@@ -3,7 +3,6 @@ package main
import (
"bytes"
"errors"
"fmt"
"log"
"net"
"sync"
@@ -91,8 +90,15 @@ retry:
connPass := <-s.signalList
_, err := connPass.conn.Write([]byte("chan"))
if err != nil {
fmt.Println(err)
log.Println(err)
goto retry
}
s.signalList <- connPass
}
func (s *Tunnel) GetTunnel() *Conn {
if len(s.tunnelList) < 10 { //新建通道
go s.newChan()
}
return <-s.tunnelList
}