Task 1 of 9
Bind to a Port
50 XP
terminal
$lux run --project build-your-own-http-server --task bind-to-a-port
Scoring
| Points | Max Attempts | Time Limit |
|---|---|---|
| 50 XP | 5 attempts | 10 min |
| 35 XP | 10 attempts | 20 min |
| 20 XP | 20 attempts | 30 min |
Instructions
Create a TCP server that listens for incoming connections on a specified port.
Your implementation should:
- Create a TCP socket
- Bind to port 4221 (or a configurable port)
- Listen for incoming connections
- Accept a connection (the connection can be closed immediately for now)
Expected behavior:
$ ./your-server
Server listening on port 4221...
Test with:
$ curl -v http://localhost:4221
(The connection will be accepted but no response sent yet)
