use predicted port range
This commit is contained in:
parent
9e96dd5c78
commit
a191de4452
|
@ -1,5 +1,6 @@
|
||||||
import asyncdispatch, asyncnet, strformat
|
import asyncdispatch, asyncnet, strformat
|
||||||
from net import IpAddress, Port, `$`, `==`
|
from net import IpAddress, Port, `$`, `==`
|
||||||
|
import port_prediction
|
||||||
import puncher
|
import puncher
|
||||||
import utils
|
import utils
|
||||||
|
|
||||||
|
@ -39,7 +40,8 @@ proc respond*(puncher: TcpNutssResponder, srcPort: Port, dstIp: IpAddress,
|
||||||
let localIp = getPrimaryIPAddr(dstIp)
|
let localIp = getPrimaryIPAddr(dstIp)
|
||||||
try:
|
try:
|
||||||
let connectFuture = newFuture[AsyncSocket]("respond")
|
let connectFuture = newFuture[AsyncSocket]("respond")
|
||||||
for dstPort in dstPorts:
|
let portRange = predictPortRange(dstPorts)
|
||||||
|
for dstPort in portRange:
|
||||||
asyncCheck connect(localIp, srcPort, dstIp, dstPort, connectFuture)
|
asyncCheck connect(localIp, srcPort, dstIp, dstPort, connectFuture)
|
||||||
await connectFuture or sleepAsync(Timeout)
|
await connectFuture or sleepAsync(Timeout)
|
||||||
if connectFuture.finished():
|
if connectFuture.finished():
|
||||||
|
|
Loading…
Reference in New Issue