The code below doesn't get any html from the url
URL url = new URL("https://google.com");
Socket socket = new Socket(url.getHost(),443);
socket.setSoTimeout(15000);
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(),"UTF-8"));
String c = "";
while((c = reader.readLine())!=null)
{
System.out.print(c);
}
reader.close();
socket.close();
I'm aware of URLConnection method openConnection() and URL class method openStream() but i don't want to use those. All i want to know is why i don't get any input using Socket class but i do get an input using other approaches.