flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.59k stars 328 forks source link

Network page does not show requests when running on Hyper-V #4997

Open hanskokx opened 1 year ago

hanskokx commented 1 year ago

Problem description

The Network page of DevTools does not show network requests when running from within a Windows 11 VM Hyper-V virtual machine. Other hypervisors and operating systems have not been tested.

Steps to reproduce

1) Run the example code on a bare-metal Windows 11 machine to verify the network request appears. 2) Run the same code on a Windows 11 Hyper-V virtual machine and observe no network request appears.

Example code

import 'dart:io';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

Future<HttpClientRequest> load() async {
  HttpClient client = HttpClient();
  final HttpClientRequest response =
      await client.get('tempapi.proj.me', 443, '/api/GB3XretjA');
  return response;
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FutureBuilder(
        future: load(),
        builder:
            (BuildContext context, AsyncSnapshot<HttpClientRequest> snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            return Text('${snapshot.data}');
          }

          return const Text("Fetching...");
        },
      ),
    );
  }
}
CoderDake commented 1 year ago

I'm going to keep an eye on this while working on some upcoming network stuff.