shikanon / socks5proxy

一个简单的socks5代理转发服务(VPN)
MIT License
193 stars 68 forks source link

error " socket: too many open files" #3

Open switchtan opened 4 years ago

switchtan commented 4 years ago

maybe in server.go line 41, dstServer, err := net.DialTCP("tcp", nil, request.RAWADDR) the same request.RAWADDR,but still build a new connect.

but i don't know how to fix it

switchtan commented 4 years ago

i fix a litte stuff in server.go line 60,

    ```

SecureCopy(dstServer, client, auth.Encrypt) readTimeout := 60 5 time.Second err = dstServer.SetReadDeadline(time.Now().Add(readTimeout)) if err != nil { log.Println("setReadDeadline failed:", err) }

shikanon commented 4 years ago

i fix a litte stuff in server.go line 60,



SecureCopy(dstServer, client, auth.Encrypt)
readTimeout := 60 * 5 * time.Second
err = dstServer.SetReadDeadline(time.Now().Add(readTimeout))
if err != nil {
log.Println("setReadDeadline failed:", err)
}

Yes, I am not set timeout to server.