Immediately and unconditionally grant new SOCKS connections.

This commit is contained in:
David Fifield 2020-01-30 23:49:41 -07:00
parent e9b218a65c
commit ee2fb42d33
2 changed files with 9 additions and 9 deletions

View file

@ -59,9 +59,17 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
log.Printf("SOCKS accepted: %v", conn.Req)
go func() {
defer conn.Close()
err := conn.Grant(&net.TCPAddr{IP: net.IPv4zero, Port: 0})
if err != nil {
log.Printf("conn.Grant error: %s", err)
return
}
err = sf.Handler(conn, snowflakes)
if err != nil {
log.Printf("handler error: %s", err)
return
}
}()
}