0Pricing
WebSockets & Real-Time Systems with Spring · Ders

WebSocket Protokolünün Temelleri

El sıkışma, çerçeveler ve bağlantı yaşam döngüsü dâhil olmak üzere temel WebSocket protokolünü ayrıntılı biçimde inceleyin.

WebSocket Protokolünün Temelleri, CoddyKit'te ücretsiz bir WebSockets & Real-Time Systems with Spring dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, WebSockets & Real-Time Systems with Spring öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. WebSockets & Real-Time Systems with Spring kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Beyond HTTP: The WebSocket Protocol

WebSockets feel like HTTP but are a distinct protocol. They open a persistent, full-duplex link so data flows both ways at once after setup.

Starting with a Handshake

Every WebSocket starts with a handshake: the client sends a normal HTTP request asking the server to upgrade the connection to WebSocket.

Client's Upgrade Request

The client's upgrade request is an HTTP GET with key headers: Upgrade: websocket, Connection: Upgrade, plus Sec-WebSocket-Key and Version.

Server's Acknowledgment

If the server accepts, it replies with 101 Switching Protocols and a Sec-WebSocket-Accept header derived from the client's key, confirming the upgrade.

Witnessing the Handshake

Watch the handshake yourself: run this in your console, open the Network tab, and look for the 101 Switching Protocols response.

/*
  Open your browser's developer console (F12),
  go to the 'Network' tab, then paste and run this code.
  Look for a '101 Switching Protocols' response!
*/
let ws = new WebSocket("wss://echo.websocket.org");

ws.onopen = (event) => {
  console.log("WebSocket connection opened!");
};

ws.onclose = (event) => {
  console.log("WebSocket connection closed!");
};

ws.onerror = (error) => {
  console.error("WebSocket error:", error);
};

// We'll send messages in later lessons!

Connection Established: Full-Duplex

After the handshake, the connection upgrades to a raw TCP link that is full-duplex: client and server send and receive independently, anytime.

How Messages are Sent: Frames

WebSocket data travels in small units called frames. Framing lets large messages fragment efficiently and supports different control message types.

Different Types of Frames

WebSocket frame types each have a job: text for strings like JSON, binary for raw data, ping/pong for heartbeats, and close to end the connection.

The Connection Journey: Lifecycle

A WebSocket follows a clear lifecycle: opening (handshake), open (exchanging frames), closing (graceful shutdown), and closed.

Quick Check: WebSocket Fundamentals

Which of the following are true about a WebSocket connection after a successful handshake?

Recap: WebSocket Protocol Essentials

You demystified the WebSocket protocol: an HTTP handshake upgrades to a persistent full-duplex channel, data moves in frames, and connections follow a lifecycle. Next: comparisons.

Sıkça Sorulan Sorular

“WebSocket Protokolünün Temelleri” dersi ücretsiz mi?

Evet — “WebSocket Protokolünün Temelleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve WebSockets & Real-Time Systems with Spring kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. WebSockets & Real-Time Systems with Spring kursu toplamda 4 dersten oluşur.

“WebSocket Protokolünün Temelleri” dersinde ne öğreneceğim?

El sıkışma, çerçeveler ve bağlantı yaşam döngüsü dâhil olmak üzere temel WebSocket protokolünü ayrıntılı biçimde inceleyin. WebSockets & Real-Time Systems with Spring ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

WebSockets & Real-Time Systems with Spring öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te WebSockets & Real-Time Systems with Spring, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“WebSocket Protokolünün Temelleri” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu WebSockets & Real-Time Systems with Spring dersinde kod yazıp çalıştırabilir miyim?

Evet. Her WebSockets & Real-Time Systems with Spring dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Gerçek Zamanlı İletişimi Anlama
  2. WebSockets ve HTTP Yoklaması Karşılaştırması
  3. WebSocket Protokolünün Temelleri
  4. Sunucu Tarafından Gönderilen Olaylar ve WebSockets Karşılaştırması
← WebSockets & Real-Time Systems with Spring Sayfasına Dön