SONUB home 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
VIBE CODING

Web Client

Everything that asks a for something.

Chrome is a web , and so is a single line of . In this chapter you type an by hand, wrap it into a script, learn curl properly, and then open Chrome's to watch the very same messages fly past.

Making a web client in the terminal

The quickest way to believe that is only text is to type a request yourself. Start the shell server from the previous topic, then open a second and talk to it by hand.

Typing a request by hand with nc

connects to a port and passes your keystrokes straight down the wire. Type the two lines, press Enter twice, and the server answers — you have just done a browser's job manually.

terminal
# connect, then type the two lines below and press Enter once more
nc localhost 8084

GET / HTTP/1.1
Host: localhost

# or send it all at once (printf's \r\n is HTTP's line break)
printf 'GET / HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc localhost 8084
  • The blank line at the end matters. It tells the server the request is finished, which is why you press Enter one extra time.
  • HTTP requires carriage-return-and-newline at the end of each line. Typing works because most servers are forgiving, but the printf version sends exactly what the standard asks for.
  • The Host line is required by HTTP/1.1. Leave it out against a real site and you will usually get an error back rather than a page.

Wrapping it into a script

Once the request is a single printf, a reusable client is a few lines. This one takes a host, a port and a path, sends the request, and splits the from the body so you can see the two parts.

client.sh
#!/bin/bash
# usage: bash client.sh localhost 8084 /

HOST=${1:-localhost}
PORT=${2:-8084}
PATH_=${3:-/}

printf 'GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n' "$PATH_" "$HOST" \
  | nc "$HOST" "$PORT" \
  | tr -d '\r' \
  | awk 'BODY { print; next } /^$/ { BODY = 1; next } { print "[header] " $0 }'

The tr command strips the carriage returns that HTTP leaves at the end of every line, and awk marks each line as a header until it meets the empty line — after that, everything is the body. This is exactly the split a browser does before it starts drawing.

Run both halves together

Start the shell server in one terminal and this client in another, and you own both ends of a conversation you wrote yourself. Change the in the server and the client sees it immediately — there is nothing else in between.

Back to the shell web server

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.