I'm looking at this document in the Flutter documentation.
When executing this example from the Android or iOS emulator, everything works like expected. When I try it from my actual Android device (Pixel 2), the connect method states an error that the request was not upgraded. Looking into my server application (ASP.NET Core 2.1), the request headers of the emulator look like this:
Cache-Control
no-cache
Connection
Upgrade
Upgrade
websocket
User-Agent
Dart/2.0 (dart:io)
and others.
Whereas the request coming from my Pixel 2 device looks like this:
Cache-Control
no-cache
Connection
Keep-Alive
Accept-Encoding
gzip
User-Agent
Dart/2.0 (dart:io)
and some others.
The question is: Why does the Pixel not send an upgrade request? Looking into the dart SDK (_http
package), the code does not give me any clue why it does not happen. Is this platform dependent, am I looking in the wrong direction?