flutter / devtools

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

[Feature request] network inspector #2558

Closed sm2017 closed 2 years ago

sm2017 commented 3 years ago

The current network inspector only shows the requested url, method of request and header of request and response

There is no way to see request body and response body, it's a must in the network inspector

It's nice to have something like chrome inspector with some advanced features like TTFB and timing, websocket and webrtc monitoring

kenzieschmoll commented 3 years ago

Which version of Flutter and which version of DevTools are you on? We do support web socket traffic as well as response bodies for HTTP / HTTPS requests.

renntbenrennt commented 3 years ago

hey @kenzieschmoll I am having the exactly same problem here.... (and this is really annoying.... because I don't want to install another package just for the sake of debug network while there's a native support of such intent but it's full of bugs..... god....

and here's my flutter info after execute flutter doctor -v

image

and in the dart dev tool view, I can see the dart dev tool is 0.9.5+1 image

And that response tab is quite inconsistent.... sometimes it show up while others don't...

you know every time I try to use this tool to debug something in front of my team... It's so embarrassing when problem like that happen... And I am the one to persuade our team to use Flutter in the first place...

Anyway, I sincerely hope the network inspecting feature can improve sooner...

Thanks for your work

sm2017 commented 3 years ago

@kenzieschmoll I am using DevTools version 0.9.3+4, How can I upgrade it? I usually upgrade flutter and it upgrade Dart SDK too

flutter doctor -v ``` [√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.18363.1256], locale en-US) • Flutter version 1.22.5 at C:\flutter • Framework revision 7891006299 (8 days ago), 2020-12-10 11:54:40 -0800 • Engine revision ae90085a84 • Dart version 2.10.4 [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\PC\AppData\Local\Android\Sdk • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = C:\Users\PC\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [!] Android Studio (version 4.1.0) • Android Studio at C:\Program Files\Android\Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [!] Connected device ! No devices available ! Doctor found issues in 2 categories. ```
kenzieschmoll commented 3 years ago

@sm2017 try flutter pub global deactivate devtools; flutter pub global activate devtools

sm2017 commented 3 years ago

@kenzieschmoll it Deactivated package devtools 0.9.3+4. and activated same version

Deactivated package devtools 0.9.3+4.
Resolving dependencies...
+ args 1.6.0
+ async 2.4.2
+ browser_launcher 0.1.8
+ charcode 1.1.3
+ collection 1.14.13
+ convert 2.1.1
+ crypto 2.1.5
+ devtools 0.9.3+4 (0.9.5+1 available)
+ devtools_server 0.9.3+4 (0.9.5+1 available)
+ devtools_shared 0.9.3+4 (0.9.5+1 available)
+ http 0.12.2
+ http_multi_server 2.2.0
+ http_parser 3.1.4
+ intl 0.16.1
+ logging 0.11.4
+ meta 1.2.4
+ mime 0.9.7
+ path 1.7.0
+ pedantic 1.9.2
+ shelf 0.7.9
+ shelf_proxy 0.1.0+7
+ shelf_static 0.2.9+1
+ source_span 1.7.0
+ sse 3.6.0
+ stack_trace 1.9.6
+ stream_channel 2.0.0
+ string_scanner 1.0.5
+ term_glyph 1.1.0
+ typed_data 1.2.0
+ usage 3.4.2
+ uuid 2.2.2
+ vm_service 5.5.0
+ webkit_inspection_protocol 0.7.4
Precompiling executables...
Precompiled devtools:devtools.
Installed executable devtools.
Warning: Pub installs executables into C:\flutter\.pub-cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated devtools 0.9.3+4.
jlubeck commented 3 years ago

I see Response body on 0.9.7+3 but no Request body?

devteam-tchs commented 3 years ago

I can't see neither response or request body on 0.9.7+3.

marko-mlinarevic commented 3 years ago

@kenzieschmoll I have same problem how did you solve it

kenzieschmoll commented 3 years ago

This is a known issue that is actively being worked on. @bkonyi is refactoring how http traffic is processed by the vm_service. Right now, responses are sent as timeline events, and large responses can cause dropped events because they fill the timeline buffer. His change will prevent this from happening and should solve this problem.

marko-mlinarevic commented 3 years ago

thanks for the fast response :)

sm2017 commented 3 years ago

We do support web socket traffic

@kenzieschmoll In chrome network inspector we can inspect WebSocket request and responses, there is no way in flutter to inspect WebSocket traffic, It just log a GET request before upgrading to WebSocket

image

sm2017 commented 3 years ago

@kenzieschmoll Chrome has a chrome://webrtc-internals page that help to inspect WebRTC, I think its very useful to have a such feature in the flutter that allow third party libraries like flutter-webrtc to add additional data in the dev tools

kenzieschmoll commented 3 years ago

@bkonyi FYI some requests around web socket information

kenzieschmoll commented 3 years ago

Chrome has a chrome://webrtc-internals page that help to inspect WebRTC, I think its very useful to have a such feature in the flutter that allow third party libraries like flutter-webrtc to add additional data in the dev tools

@jacob314 perhaps another 3p request for better extensibility with DevTools

quangkhaidam93 commented 1 year ago

We do support web socket traffic

@kenzieschmoll In chrome network inspector we can inspect WebSocket request and responses, there is no way in flutter to inspect WebSocket traffic, It just log a GET request before upgrading to WebSocket

image

Could you advise me how to inspect Flutter websocket connection via Chrome Dev Tools? I inspect from Debugger tool page and there is no web socket connection

CoderDake commented 1 year ago

@quangkhaidam93 Have you tried doing this with Dart Devtools? I think websocket requests show up there. If you have issues there then perhaps open up a fresh issue so we can explore that in more depth. We can link this issue in that new issue if needed.

whiskas commented 7 months ago

yep I have the same feature request we need ws messages in devtool image