dio
dio copied to clipboard
How to use proxy with dio_http2_adapter
I can set proxy with default httpClientAdapter. But with dio_http2_adapter, cannot set proxy. Anyone know how to set proxy with dio_http2_adapter?
the same question for me. Anyone know?
you can use charles + postern to catch http2, may be need to trust charles certificate on your phone
I can set proxy with default httpClientAdapter. But with dio_http2_adapter, cannot set proxy. Anyone know how to set proxy with dio_http2_adapter?
No, you can't set proxy with this implementation of dio_http 2_adapter. The reason is that dart http 1 client implement tunnel proxy out of box, http2 dont. You can write your own implementation of Connection Manager that support tunnel connection. Example is here: https://github.com/dart-lang/http2/issues/48#issuecomment-749491710
To get proxy host and port you need to ask system like this in android: System.getProperty("http.proxyHost"), System.getProperty("http.proxyPort")