I have refactored code so that 9090 is wss only, regular http traffic is on 8080
This is log of tcpdump. I do not know difference of 'sent' vs 'received again' ; does tcpdump show that ?
cpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on lo, link-type EN10MB (Ethernet), snapshot length 262144 bytes
06:16:52.712469 IP 127.0.0.1.45708 > 127.0.0.1.9090: Flags [P.], seq 1647320834:1647320864, ack 2762297653, win 0, options [nop,nop,TS val 4262128213 ecr 4262087416], length 30
06:16:52.712569 IP 127.0.0.1.9090 > 127.0.0.1.45708: Flags [R], seq 2762297653, win 0, length 0
06:16:53.462788 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [S], seq 1690290263, win 65495, options [mss 65495,sackOK,TS val 4262128963 ecr 0,nop,wscale 7], length 0
06:16:53.462805 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [S.], seq 698107113, ack 1690290264, win 65483, options [mss 65495,sackOK,TS val 4262128963 ecr 4262128963,nop,wscale 7], length 0
06:16:53.462818 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 1, win 512, options [nop,nop,TS val 4262128963 ecr 4262128963], length 0
06:16:53.462997 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [P.], seq 1:518, ack 1, win 512, options [nop,nop,TS val 4262128963 ecr 4262128963], length 517
06:16:53.463006 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], ack 518, win 508, options [nop,nop,TS val 4262128963 ecr 4262128963], length 0
06:16:53.465078 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 1:4732, ack 518, win 512, options [nop,nop,TS val 4262128965 ecr 4262128963], length 4731
06:16:53.465091 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 4732, win 489, options [nop,nop,TS val 4262128965 ecr 4262128965], length 0
06:16:53.465451 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [P.], seq 518:582, ack 4732, win 512, options [nop,nop,TS val 4262128966 ecr 4262128965], length 64
06:16:53.465714 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 4732:5144, ack 582, win 512, options [nop,nop,TS val 4262128966 ecr 4262128966], length 412
06:16:53.465753 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [P.], seq 582:1105, ack 5144, win 509, options [nop,nop,TS val 4262128966 ecr 4262128966], length 523
06:16:53.466267 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 5144:5332, ack 1105, win 512, options [nop,nop,TS val 4262128966 ecr 4262128966], length 188
06:16:53.475630 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [P.], seq 1105:1161, ack 5332, win 512, options [nop,nop,TS val 4262128976 ecr 4262128966], length 56
06:16:53.475644 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 5332:5368, ack 1161, win 512, options [nop,nop,TS val 4262128976 ecr 4262128976], length 36
06:16:53.515731 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 5368, win 512, options [nop,nop,TS val 4262129016 ecr 4262128976], length 0
06:16:53.515747 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 5368:5500, ack 1161, win 512, options [nop,nop,TS val 4262129016 ecr 4262129016], length 132
06:16:53.515756 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 5500, win 511, options [nop,nop,TS val 4262129016 ecr 4262129016], length 0
06:16:54.129078 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 5500:38268, ack 1161, win 512, options [nop,nop,TS val 4262129629 ecr 4262129016], length 32768
06:16:54.129110 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 38268, win 379, options [nop,nop,TS val 4262129629 ecr 4262129629], length 0
06:16:54.129163 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 38268:71036, ack 1161, win 512, options [nop,nop,TS val 4262129629 ecr 4262129629], length 32768
06:16:54.129168 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 71036:71124, ack 1161, win 512, options [nop,nop,TS val 4262129629 ecr 4262129629], length 88
06:16:54.129182 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 71036, win 123, options [nop,nop,TS val 4262129629 ecr 4262129629], length 0
06:16:54.129664 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 71124, win 512, options [nop,nop,TS val 4262129630 ecr 4262129629], length 0
06:16:54.129718 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 71124:103892, ack 1161, win 512, options [nop,nop,TS val 4262129630 ecr 4262129630], length 32768
06:16:54.129731 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 103892:136660, ack 1161, win 512, options [nop,nop,TS val 4262129630 ecr 4262129630], length 32768
06:16:54.129996 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 136660, win 0, options [nop,nop,TS val 4262129630 ecr 4262129630], length 0
06:16:54.130198 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 136660, win 379, options [nop,nop,TS val 4262129630 ecr 4262129630], length 0
06:16:54.130218 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 136660:169428, ack 1161, win 512, options [nop,nop,TS val 4262129630 ecr 4262129630], length 32768
06:16:54.130442 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 169428, win 512, options [nop,nop,TS val 4262129631 ecr 4262129630], length 0
06:16:54.130471 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 169428:202196, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130479 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 202196:234964, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130488 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 234964, win 0, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130524 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 234964, win 379, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130545 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 234964:267732, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130583 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 267732, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130618 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 267732:300500, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130628 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 300500:333268, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130637 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 300500, win 1535, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130714 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 333268:366036, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130725 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 366036:398804, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130734 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 398804:431572, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130743 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 431572:464340, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130752 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 333268, win 2559, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130817 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 464340:497108, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130828 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 497108:529876, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130837 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 529876:562644, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130846 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 562644:595412, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130855 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 595412:628180, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130863 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 366036, win 3582, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130906 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 628180:660948, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130918 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 660948:693716, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130927 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 693716:726484, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130935 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 398804, win 4605, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.130967 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 726484:759252, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.130977 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 759252:792020, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131000 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 431572, win 5628, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131032 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 792020:824788, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131043 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 824788:857556, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131051 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 464340, win 6651, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131058 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 497108, win 7674, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131064 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 529876, win 8698, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131071 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 562644, win 9721, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131077 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 595412, win 10744, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131084 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 857556:890324, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131083 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 628180, win 11767, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131088 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 660948, win 12790, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131095 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 693716, win 13813, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131104 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 890324:923092, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131101 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 726484, win 14837, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131106 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 759252, win 15860, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131112 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 792020, win 16883, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131115 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [.], seq 923092:955860, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768
06:16:54.131118 IP 127.0.0.1.51438 > 127.0.0.1.9090: Flags [.], ack 824788, win 17906, options [nop,nop,TS val 4262129631 ecr 4262129631], length 0
06:16:54.131123 IP 127.0.0.1.9090 > 127.0.0.1.51438: Flags [P.], seq 955860:988628, ack 1161, win 512, options [nop,nop,TS val 4262129631 ecr 4262129631], length 32768