When I make http requests in dart or flutter a websocket request always comes after it. I wondered is it from packages and write a flat dart script but it didn't solve the problem. Here is the script that I wrote.
import 'dart:io';
main(List<String> args) async {
while (true) {
final client = HttpClient();
await Future.delayed(Duration(seconds: 10));
final req = await client.getUrl(Uri.parse('https://example.com/'));
await req.close();
client.close();
}
}
here is the output of my debug
it may have something with the httpclient because when I force close it websocket requests end instead of pending.
So question is what is the reason that websocket request happen ?
Dart Version: 2.12.3 (stable)