https://github.com/d12/bash-http-server
Fully (sort of) functional bash HTTP server.
https://github.com/d12/bash-http-server
Last synced: 11 months ago
JSON representation
Fully (sort of) functional bash HTTP server.
- Host: GitHub
- URL: https://github.com/d12/bash-http-server
- Owner: d12
- Created: 2016-06-19T21:13:16.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-15T15:36:40.000Z (almost 9 years ago)
- Last Synced: 2025-04-14T10:48:00.368Z (about 1 year ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 9
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bash-HTTP-Server
Fully (sort of) functional bash HTTP server.
## What it does
- Responds to GET requests with webpages/files
- Can serve text and binary files
- Correctly sets response headers (including MIME type)
- Correctly sets HTTP response codes, and can load error pages for each error
- Ran a bootstrap webpage off of it as a test, all works perfectly
## What it doesn't do
- Execute PHP
- Handle URL parameters (easy fix, it will maybe be done some day)
- Run on a machine that means anything to you (there are a few minor security issues)
## Why?
- Wanted to learn bash
- Wanted to learn more about networking and architecture
- Decided to put em together
## How to use it
1. Put both files on your machine
2. `./server.sh`
3. Script will now handle GET requests to the IP on port 80 (default HTTP port)
By default, server root is `~/server`, can be configured by changing the first line in `grab_resource` to something else.