http(s)

 

Web tarayıcınızı açtığınızda, genellikle HTTP ve HTTPS protokollerini kullanırsınız. HTTP, "Hypertext Transfer Protocol" anlamına gelir ve HTTPS'in "S" harfi, "Secure" yani güvenli olduğunu belirtir. Bu protokol, TCP'yi temel alır ve web tarayıcınızın web sunucularıyla nasıl iletişim kurduğunu tanımlar.

Web tarayıcınızın genellikle web sunucusuna gönderdiği bazı komutlar veya yöntemler şunlardır:

  • GET: Sunucudan veri almak için kullanılır, örneğin bir HTML dosyası veya bir resim.

  • POST: Sunucuya yeni veri göndermek için kullanılır, örneğin bir formu göndermek veya bir dosya yüklemek.

  • PUT: Sunucuda yeni bir kaynak oluşturmak ve mevcut bilgileri güncelleyip üzerine yazmak için kullanılır.

  • DELETE: Adından da anlaşılacağı gibi, sunucudaki belirli bir dosya veya kaynağı silmek için kullanılır.

HTTP ve HTTPS, sırasıyla genellikle TCP'nin 80 ve 443 numaralı portlarını kullanır, ancak bazen 8080 ve 8443 gibi diğer portlar da kullanılabilir.

Aşağıdaki örnekte, Firefox tarayıcımızı kullanarak 10.10.19.170 adresindeki web sunucusuna erişiyoruz. Tarayıcımız web sayfasını düzgün bir şekilde görüntüler, ancak biz, perde arkasında neler olup bittiğini incelemek istiyoruz.

Örnek Web Sayfası (Tarayıcıda Gösterildiği Gibi)

Wireshark kullanarak, Firefox tarayıcısı ile web sunucusu arasındaki iletişimi daha yakından inceleyebiliriz. Aşağıdaki Wireshark ekran görüntüsünde, tarayıcımızın gönderdiği metin kırmızı renkte, web sunucusunun yanıtı ise mavi renkte gösterilmektedir. Gördüğünüz gibi, kullanıcıya gösterilmeyen çok sayıda bilgi, istemci ile sunucu arasında değiş tokuş edilir. Örnekler arasında web sunucu sürümü ve sayfanın en son ne zaman değiştirildiği gibi bilgiler bulunur.

Wireshark ile Yakalanan Veriler

Ağ Kavramları'ndan hatırlayacağınız gibi, 10.10.19.170 adresindeki web sunucusuna port 80 üzerinden bağlanmak için telnet istemcisini kullanmıştık. Sayfayı almak için birkaç satır göndermemiz gerekiyordu: GET / HTTP/1.1 ve Host: anything. (Bazı sunucularda, Host: anything göndermeseniz de dosyayı alabilirsiniz.) Bu yöntemi kullanarak herhangi bir sayfaya erişebilirsiniz, sadece varsayılan sayfa değil. Örneğin, GET /file.html HTTP/1.1 komutunu göndererek file.html dosyasını alabilirsiniz (bu, kullanılan web sunucusuna bağlı olarak çalışabilir). Bu yaklaşım, sunucu ile "HTTP" üzerinden iletişim kurarak sorun giderme için verimli bir yöntemdir.


English Explanation:

When you fire up your browser, you mainly use HTTP and HTTPS protocols. HTTP stands for Hypertext Transfer Protocol, and the "S" in HTTPS stands for Secure. This protocol relies on TCP and defines how your web browser communicates with web servers.

Some of the commands or methods that your web browser commonly issues to the web server are:

  • GET: Retrieves data from a server, such as an HTML file or an image.

  • POST: Allows you to submit new data to the server, such as submitting a form or uploading a file.

  • PUT: Used to create a new resource on the server and to update or overwrite existing information.

  • DELETE: As the name suggests, used to delete a specified file or resource on the server.

HTTP and HTTPS commonly use TCP ports 80 and 443, respectively, but less commonly other ports like 8080 and 8443 may also be used.

In the following example, we use our Firefox browser to access the web server at 10.10.19.170. Our browser fetches the web page and displays it perfectly, but we are interested in what happens behind the scenes.

Example Website as Displayed in a Web Browser

Using Wireshark, we can examine the exchange between the Firefox browser and the web server more closely. The screenshot below from Wireshark shows the text sent by our browser in red, and the web server's response in blue. As you can see, a lot of information is exchanged between the client and the server that does not get rendered to the user. Examples include the web server version and when the page was last modified.

Data Exchanged Between Web Browser and Web Server Captured by Wireshark

As you remember from Networking Concepts, we used the telnet client to connect to the web server running on 10.10.19.170 at port 80. We had to send a couple of lines: GET / HTTP/1.1 and Host: anything to get the page we wanted. (On some servers, you might get the file without sending Host: anything.) You can use this method to access any page, not just the default page /. For example, to get file.html, you would send GET /file.html HTTP/1.1 (this may work depending on the web server). This approach is efficient for troubleshooting as you would be "talking HTTP" with the server.