Skip to content

Some pretty shitty HTTP server implementation using multithreading and async.

Notifications You must be signed in to change notification settings

ShashwatAgrawal20/rust-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A shitty http server build for learning purposes

I am not doing any directory sanitization nor am I doing any verification if the flag is --directory only

EndPoints

A GET request to files/{filename} will give back the content of the file if that exists in the directory you mentioned while starting the server using the --directory flag.

A POST request to files/{filename} with the data in the body will fetch the contents of the file from the request body and save it to / on the given directory.

Command to Start the server

./server.sh

OR

./server.sh --directory `pwd`

use ^ to access all 4 endpoints

Example Commands to Request Data

curl -v http://127.0.0.1:4221/echo/oooooooo
curl -v http://127.0.0.1:4221/echo/user-agent

NOTE:- In order for these commands to work you need the --directory flag.

curl -v http://127.0.0.1:4221/echo/files/Cargo.toml
curl -d 'ooooooooo' -v http://127.0.0.1:4221/files/test.txt

About

Some pretty shitty HTTP server implementation using multithreading and async.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published