OkayTeacher
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

All Vibe Coding topics

Web Server

Twenty lines of that a will talk to.

A web server is just a program that waits for a request and sends a response. Build one from 20 lines of bash and netcat, then move on to Caddy with HTTPS.

A clerk behind a small window listens to a queue of visitors (a laptop, a phone and a small robot), each holding a request note, with a looping arrow above the window.
A web is a clerk at a window: wait, read the request, hand back the page, and wait again.

What actually travels down the wire

Open the connection and you find you could have typed yourself. This is the whole reason the shell server is possible — and the reason you can a web problem by reading, rather than guessing.

The request the browser sends

request
GET / HTTP/1.1
Host: localhost:8084
User-Agent: Mozilla/5.0
Accept: text/html
  • The first line is the only part our server reads: the method ( means fetch, means send something), the path, and the .
  • says which site is wanted. One server can hold hundreds of domains on one address, and this is how it tells them apart.
  • The rest are the browser introducing itself: what it is, what formats it can read, what languages it prefers. A server may use them or ignore them.

The response the server sends

response
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Connection: close

<h1>Hello</h1>
  • The : the protocol version and a saying how it went. means the succeeded.
  • tells the browser how to read what follows. Send with the wrong type and the browser will show your as text instead of a page.
  • The part is not optional in practice. Without it, any non-English text is likely to arrive as garbled characters.
  • Then one , and everything after it is the content. That blank line is the entire border between the headers and the page.

Status codes worth knowing

CodeMeaning
200 OKSuccess. The contains what was asked for. Codes in the all mean some flavour of that.
301 Moved PermanentlyIt moved, permanently. The new address is in the and the browser follows it automatically — this is how a site sends visitors from to https (some, like , use , which means the same).
404 Not FoundThe server is fine but that path does not exist. Codes in the mean the problem is in the request.
500 Internal Server ErrorThe server broke while handling a perfectly good request. Codes in the mean the problem is yours to fix, and the details are in the .

You mark this yourself. Nothing is graded here.

Mark this step as understood?

This cannot be undone yet, so mark it only when you really understand.

Marked as understood

You mark this yourself. Nothing is graded here.