title: Unable to Connect Emulator with localhost ? Android | Firebase
body: <p>I am trying to save emulator's token number into localhost (wampserver-phpMyAdmin).</p>
  
  <p>System is giving -> Failed to connect to localhost/127.0.0.1:80</p>
  
  <p><a href="https://github.com/satinderjg/GCMFirebase" rel="nofollow noreferrer">here is full code link</a> </p>
  
  <p>This is the function in which i tried to register my token</p>
  
  <pre><code>private  void registertoken(String token){
  
      Log.d(TAG, "registertoken: registion begins !!!!!!!! \n !!!!!!!!!!!!! ");
  
      OkHttpClient client = new OkHttpClient();
      RequestBody body = new FormBody.Builder()
              .add("Token",token)
              .build();
  
      Request request = new Request.Builder()
              .url("http://localhost/fcm/register.php")
  
              .post(body)
              .build();
     // http://fcm/register.php
      try {
          client.newCall(request).execute();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This is PHP file I am using :</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST["Token"])){
  $token = $_POST["Token"];
  $conn = mysqli_connect("localhost","root","","fcm");
  $query = "INSERT INTO user(Token) Values ('$token') ON 
  DUPLICATE KEY UPDATE Token = '$token' ; ";
  mysqli_query($conn,$query);
  mysqli_close($conn);
  }
  ?&gt;
  </code></pre>