What is the actual process that will take place when we type an url in the address bar of the browser [duplicate]
Possible Dupl开发者_开发问答icates:
what happens when you type in a URL in browser what happen after i press enter to the web browser after typing google.com
Recently i have attended an interview, in that interview i was questioned "What is the actual process that will happen when we type an url in the address bar of the browser and click enter" for example "www.gmail.com"....what is the process. And also i was questioned that what is the server that will will be working for this purpose.......
This is pretty off topic for this site, but it might be fun to try to answer this complex question:
Your browser, if it doesn't already know, will ask your OS's DNS system what the address (IP address) of the host ("www.google.com," for example) is. If your OS doesn't know, it will query third-party DNS servers (those of your ISP, for example).
Once an address is obtained, your web browser establishes a TCP/IP socket connection, typically on TCP port 80, with the web server at the IP address it resolved the host name to.
Once your browser has established this connection, it sends an HTTP GET request to the web server for whatever resource was requested in your URL. For example, http://www.google.com/ would mean you'd send a '/' request to whatever web server is at www.google.com.
The web server will then, typically, respond to the request with an HTTP response, typically containing HTML. Your web browser downloads this response.
Your web browser renders the HTML. It may need to send additional requests for any scripts, stylesheets, images, or other resources linked to in the HTML.
That's a really basic outline. To get the full picture, you should do some research into DNS, TCP/IP, HTTP, and HTML.
精彩评论