From a191de4452c861cb53b80216132bfa07a0b37d4f Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Thu, 15 Oct 2020 19:20:44 +0200 Subject: [PATCH] use predicted port range --- tcp_nutss_responder.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcp_nutss_responder.nim b/tcp_nutss_responder.nim index 280ab8f..11056bc 100644 --- a/tcp_nutss_responder.nim +++ b/tcp_nutss_responder.nim @@ -1,5 +1,6 @@ import asyncdispatch, asyncnet, strformat from net import IpAddress, Port, `$`, `==` +import port_prediction import puncher import utils @@ -39,7 +40,8 @@ proc respond*(puncher: TcpNutssResponder, srcPort: Port, dstIp: IpAddress, let localIp = getPrimaryIPAddr(dstIp) try: let connectFuture = newFuture[AsyncSocket]("respond") - for dstPort in dstPorts: + let portRange = predictPortRange(dstPorts) + for dstPort in portRange: asyncCheck connect(localIp, srcPort, dstIp, dstPort, connectFuture) await connectFuture or sleepAsync(Timeout) if connectFuture.finished():