Skip to content

StickOnAStick/HTTPServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMPE 183 - Netwowrking / Advanced CS topics

Build and Run

Linux:

  1. Compile the server:

    make
  2. Run the server:

    ./bin/server
  3. Clean up the object files:

     make clean

Pi Pico-W: We use cmakelists.txt and PiSDK for running on the Pi Pico-W.

  1. Setup the Pico SDK

    git clone -b master https://github.com/raspberrypi/pico-sdk.git`
    cd pico-sdk
    git submodule update --init
    export PICO_SDK_PATH=$(pwd)
  2. Compile the code

    mkdir build
    cd build
    cmake ..
    make -j$(nproc)
  3. Flash to the Pico W

  • Hold the BOOTSEL button, connect to a computer via USB.
  • Drag the .uf2 file to the RPI-RP2 drive.

Testing

To test the server you must have a stable connection to the device hosting it unless running locally.

This guide will use localhost for simplicity. If running on an external device replace this with the IP address of your device. ex: 172.16.80.251.

The port number could also differ depending on the device. Linux runs on :8080 while Pi devices run on :80

Get a basic text response:

curl http://localhost:8080/
Hello World!

Get a file:

curl http://localhost:80/data/index.html

References

Primary Source: RFC 9910 Standard

Secondary Sources (HTTP 0.9/1 RFC 1945): W3 HTTP -&- DataTracker Documentation

About

An HTTP server written from scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published