Open rasgele opened 3 years ago
Here is first 9 packages sent to proxy:
"No.","Time","Source","srcport","Destination","tgtport","Protocol","Length","Info"
"1","0.000000","127.0.0.1","53645","127.0.0.1","5555","TCP","108","53645 > 5555 [SYN] Seq=0 Win=64240 Len=0 MSS=65495 WS=256 SACK_PERM=1"
"2","0.000978","127.0.0.1","5555","127.0.0.1","53645","TCP","108","5555 > 53645 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=1 SACK_PERM=1"
"3","0.001031","127.0.0.1","53645","127.0.0.1","5555","TCP","84","53645 > 5555 [ACK] Seq=1 Ack=1 Win=65536 Len=0"
"4","0.002656","127.0.0.1","53646","127.0.0.1","5555","TCP","108","53646 > 5555 [SYN] Seq=0 Win=64240 Len=0 MSS=65495 WS=256 SACK_PERM=1"
"5","0.003438","127.0.0.1","5555","127.0.0.1","53646","TCP","108","5555 > 53646 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=1 SACK_PERM=1"
"6","0.003504","127.0.0.1","53646","127.0.0.1","5555","TCP","84","53646 > 5555 [ACK] Seq=1 Ack=1 Win=525568 Len=0"
"7","0.004306","127.0.0.1","53645","127.0.0.1","5555","HTTP","193","CONNECT httpbin.org:80 HTTP/1.1 "
"8","0.004346","127.0.0.1","5555","127.0.0.1","53645","TCP","84","5555 > 53645 [ACK] Seq=1 Ack=110 Win=65426 Len=0"
"9","0.005058","127.0.0.1","53646","127.0.0.1","5555","HTTP","193","CONNECT httpbin.org:80 HTTP/1.1 "
Packet 1 and 4 shows SYN packages over different sockets (from port 53645 and 53646).
It seems maxSockets agent option is ignored when HttpProxyAgent is used.
Console output is :
As you see, in contrast to http.Agent, hpagent sends second request immediately, without waiting for first socket to finish.