title: My response seems to hang in response class while working with sockets
body: <p>I am currently implementing a web proxy but i have run into a problem.I can parse my request from the browser and make a new request quite alright but i seem to have a problem with response.It keeps hanging inside my response loop</p>
  
  <pre><code>    serveroutput.write(request.getFullRequest());
              //  serveroutput.newLine();
                  serveroutput.flush();
                  //serveroutput.
                   //serveroutput.close();
              } catch (IOException e) {
                  System.out.println("Writting tothe server was unsuccesful");
                  e.printStackTrace();
              }
              System.out.println("Write was succesful...");
               System.out.println("flushed.");
  
               try {
                   System.out.println("Getting a response...");
                   response= new    HttpResponse(serversocket.getInputStream());
          } catch (IOException e) {
                  System.out.println("tried to read response from server but failed");
                  e.printStackTrace();
              }
  
                System.out.println("Response was succesfull");
  
  
  
        //response code
  
          public HttpResponse(InputStream input) {
      busy=true;
  
        reader = new BufferedReader(new InputStreamReader(input));
        try {
            while (!reader.ready());//wait for initialization.
  
            String line;
            while ((line = reader.readLine()) != null) {
                fullResponse += "\r\n" + line;
  
  
            }
  
            reader.close();
            fullResponse = "\r\n" + fullResponse.trim() + "\r\n\r\n";
        } catch (IOException`` e) {
  
            e.printStackTrace();
        } 
        busy = false;
    }
  </code></pre>