title: My flutter app doesn't connect to the internet when is on private network (vpn)
body: <p>I'm making an App for my company and I need it to work on a private network (VPN) but when I'm on VPN it doesn't work, tried to print the result witch should give me a json instead gives me this "</p>
  
  <blockquote>
    <p>401 - Unauthorized: Access is denied due to invalid
    credentials.</p>
  </blockquote>
  
  <p>", but if I change the URL to "[<a href="https://randomuser.me/api/?results=15][1]" rel="nofollow noreferrer">https://randomuser.me/api/?results=15][1]</a>" I get the data with no problem.
  I tried to check connectivity when I'm on VPN and gives me result none.</p>
  
  <pre><code>...
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    var _connection = 'Unknown';
    Connectivity connectivity;
    StreamSubscription&lt;ConnectivityResult&gt; subscription;
  
    String url = 'myUrl';
    List data;
  
    Future&lt;String&gt; makeRequest() async {
      var response = await http
          .post(url, headers: {'Accept': 'application/json'});
  
    print('________________________________________________________________________^^^^ '+ response.body );
      setState(() {
        var extractdata = json.decode(response.body);
        //data = extractdata;
        //print( data[0]["name"]["first"]);
      });
  
    }
  
    @override
    void initState() {
      super.initState();
      connectivity = new Connectivity();
      subscription = connectivity.onConnectivityChanged.listen( (ConnectivityResult result){print('RESULT');print(result);});
      this.makeRequest();
    }
  
    @override
    void dispose(){
      subscription.cancel();
      super.dispose();
    }
  ...
  </code></pre>
  
  <p>this is the console result</p>
  
  <pre><code>Performing hot restart...
  Syncing files to device SM J500FN...
  Restarted application in 5 173ms.
  I/flutter (16502): RESULT
  I/flutter (16502): ConnectivityResult.none
  I/flutter (16502): ________________________________________________________________________^^^^ &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  I/flutter (16502): &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  I/flutter (16502): &lt;head&gt;
  I/flutter (16502): &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/&gt;
  I/flutter (16502): &lt;title&gt;401 - Unauthorized: Access is denied due to invalid credentials.&lt;/title&gt;
  I/flutter (16502): &lt;style type="text/css"&gt;
  I/flutter (16502): &lt;!--
  I/flutter (16502): body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
  I/flutter (16502): fieldset{padding:0 15px 10px 15px;} 
  I/flutter (16502): h1{font-size:2.4em;margin:0;color:#FFF;}
  I/flutter (16502): h2{font-size:1.7em;margin:0;color:#CC0000;} 
  I/flutter (16502): h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
  I/flutter (16502): #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
  I/flutter (16502): background-color:#555555;}
  I/flutter (16502): #content{margin:0 0 0 2%;position:relative;}
  I/flutter (16502): .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
  I/flutter (16502): --&gt;
  I/flutter (16502): &lt;/style&gt;
  I/flutter (16502): &lt;/head&gt;
  I/flutter (16502): &lt;body
  E/flutter (16502): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 1)
  E/flutter (16502): &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org...
  E/flutter (16502): ^
  E/flutter (16502): 
  E/flutter (16502): #0      _ChunkedJsonParser.fail (dart:convert/runtime/libconvert_patch.dart:1357:5)
  E/flutter (16502): #1      _ChunkedJsonParser.parseNumber (dart:convert/runtime/libconvert_patch.dart:1253:9)
  E/flutter (16502): #2      _ChunkedJsonParser.parse (dart:convert/runtime/libconvert_patch.dart:921:22)
  E/flutter (16502): #3      _parseJson (dart:convert/runtime/libconvert_patch.dart:29:10)
  E/flutter (16502): #4      JsonDecoder.convert (dart:convert/json.dart:491:36)
  E/flutter (16502): #5      JsonCodec.decode (dart:convert/json.dart:149:41)
  E/flutter (16502): #6      _MyHomePageState.makeRequest.&lt;anonymous closure&gt; (package:doi_report/homepage.dart:30:30)
  E/flutter (16502): #7      State.setState (package:flutter/src/widgets/framework.dart:1122:30)
  E/flutter (16502): #8      _MyHomePageState.makeRequest (package:doi_report/homepage.dart:29:5)
  E/flutter (16502): &lt;asynchronous suspension&gt;
  E/flutter (16502): #9      _MyHomePageState.initState (package:doi_report/homepage.dart:42:10)
  E/flutter (16502): #10     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3846:58)
  E/flutter (16502): #11     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
  E/flutter (16502): #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #13     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #14     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
  E/flutter (16502): #15     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #17     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
  E/flutter (16502): #18     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
  E/flutter (16502): #19     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
  E/flutter (16502): #20     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
  E/flutter (16502): #21     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #23     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
  E/flutter (16502): #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #25     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #26     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
  E/flutter (16502): #27     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #28     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #29     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
  E/flutter (16502): #30     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #31     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #32     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
  E/flutter (16502): #33     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #35     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
  E/flutter (16502): #36     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
  E/flutter (16502): #37     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
  E/flutter (16502): #38     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)
  E/flutter (16502): #39     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
  E/flutter (16502): #40     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
  E/flutter (16502): #41     Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
  E/flutter (16502): #42     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
  E/flutter (16502): #43     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
  E/flutter (16502): #44     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
  E/flutter (16502): #45     ComponentElement.mount (package:flutter/src/widgets/```
  
  
  
  </code></pre>