Skip to content

Simple-C-WebServer is a basic example of a minimal web server.

Notifications You must be signed in to change notification settings

plastic-bottleneck/scws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[🌲] SCWS :: Simple C WebServer [🌲]

Simple C WebServer should be an example for a minimalistic C based WebServer.
It's free to use or copy for anyone. It's meant to be forked, optimized, etc..

🔧 Install

To compile scws from source, you'll need the following apckages preinstalled:

📌 Debian

  • libmicrohttpd-dev
sudo apt update && sudo apt-get install libmicrohttpd-dev

📌 OpenBSD

  • libmicrohttpd
doas pkg_add libmicrohttpd

📌 Gentoo

  • libmicrohttpd
doas emerge net-libs/libmicrohttpd

📌 Fedora

  • libmicrohttpd
sudo dnf install libmicrohttpd-devel

📌 MacOS

  • libmicrohttpd-dev
brew install libmicrohttpd

👉 SCWS install:

git clone https://github.com/plastic-bottleneck/scws && cd scws
make

🔧 Usage

It is important to keep your index.html and style.css files inside of the root folder of the compiled binary file. You can change the location in the scws.c file though. To run SCWS, do this (You can also leave the ip and port option empty to default to your local IPv4 and port 8888):

./scws [ip] [port]

When the server is running, you should get the following output:

[!!] Yay! Server is running on 0.0.0.0:8888

Now go to http://0.0.0.0:8888/ and see the following example website:

plus


🍪 Made by Paul alias Plastic Bottleneck
GitHub: https://github.com/plastic-bottleneck
Check out my own Distro at 1.4Mb! https://github.com/plastic-bottleneck/plus-linux

About

Simple-C-WebServer is a basic example of a minimal web server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published