A purely bash web server, no socat, netcat, etc...

Overview

Bash-web-server

A purely bash web server, no socat, netcat, etc...

Requirement

How to

The port can be set by the env var: HTTP_PORT

The path to accept (Directory) can be set by using: BASH_LOADABLE_PATH

The scripts need a file as first argument which will be source. The file will need a function named runner, which will be run on each request

Problems...

Well there's a little problem... since accept doesn't close the connection (Or i'm doing something wrong), the connection will go into TIME_WAIT. This means that we need to wait the time the connection will be closed, after that we can reopen a connection. I will have a look at the source code and probably provide some options, like a bind-address and a close when the FD is closed.

UPDATE:

Accept has been patched by me. Now we can handle multiple request at the same time, without waiting the TIME_WAIT.

To use the new accept, you will need to compile the accept from this repo, a pull request will be send to bash, but it will take some time.

TODO

  • Implement logging and provide a logging format like httpd
  • Implement multi processing (this will be a huge step, but we need to patch accept)
  • Implement urlencode/decode to provide readable get data
Issues
  • "Cannot load accept" despite bash 5.2.0(1)-alpha

    I tried to make it work on the 5.2.0(1)-alpha version of bash

    • i have the "cannot load accept" error

    I tried with bash 5.0

    • Applying the patch said it has some rejection, it is normal?
    • Compiling the patched accept.c isn't smooth at all i have no clue how to do it.
    • Also even if i had it to compile what i am supposed to do with the binary in the end?

    Any idea? thanks.

    opened by ForwardFeed 2
Owner
Just a simple Linux System Administrator
null
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 8.6k Aug 8, 2022
Simple, secure & standards compliant web server for the most demanding of applications

Simple, secure[1] & standards compliant[2] web server for the most demanding[3] of applications. Read more... ?? Optimized security Being meticulously

uNetworking AB 14.1k Aug 8, 2022
When you need a web server in a hurry.

darkhttpd https://unix4lyfe.org/darkhttpd/ When you need a web server in a hurry. Features: Simple to set up: Single binary, no other files, no instal

Emil Mikulic 824 Aug 9, 2022
web server that will print hello world on the screen only for linux users

a simple http server side lib only for linux users Note: This lib is currently under development you can check the source code and even use it but dn'

notaweeb 11 Mar 14, 2021
cServe : mean and lean web server written in c

cServe =========== cServe is a web server written in c for POXIS compliant operating systems cServe is planned to be [ ] Supporting HTTP/1.x and HTTP/

Ayush Kumar 1 Dec 21, 2021
reverse proxy with web server and preview page

Reverse Proxy Dependencies Go Make Suport Termux (android/afsd kernel) linux (kernel) Install: Termux: 1 step: Install Go-lang, Git and Make pkg insta

AlbâniaSecurity-RT 7 Feb 19, 2022
Update ESP32 firmware over WiFi from a web server

esp32-firmware-update Update ESP32 firmware over WiFi from Github This includes a python script which generates the update json file based on the firm

Felix Biego 9 Jun 28, 2022
LAppS - Lua Application Server for micro-services with default communication over WebSockets. The fastest and most vertically scalable WebSockets server implementation ever. Low latency C++ <-> Lua stack roundtrip.

LAppS - Lua Application Server This is an attempt to provide very easy to use Lua Application Server working over WebSockets protocol (RFC 6455). LApp

null 47 Apr 25, 2022
Windows named pipe server that forwards connections to given TCP server

PipeTcp An asynchronous Windows named pipe server that forwards connections to given TCP server. Pre-built binaries can be found in Releases. Invocati

Jinoh Kang 4 May 23, 2022
A project designed for the esp8266 D1 Mini or the esp8266 D1 Mini PRO to provide a wifi http server and dns server.

PS4 Server 9.00 This is a project designed for the esp8266 D1 Mini or the esp8266 D1 Mini PRO to provide a wifi http server and dns server. this is fo

null 13 Jun 7, 2022
Nagios Plugin to check Call Quality in SIP VoIP (compatible checkmk, etc)

sipnagios Nagios Plugin to check Call Quality in SIP VoIP (compatible with check_mk, Zabbix, etc) sipnagios implements the Nagios plugin API for monit

null 23 Nov 16, 2021
C library to create simple HTTP servers and Web Applications.

Onion http server library Travis status Coverity status Onion is a C library to create simple HTTP servers and Web Applications. master the developmen

David Moreno Montero 1.9k Aug 1, 2022
An asynchronous web framework for C++ built on top of Qt

!!! I can no longer maintain this project. If you're interessed, please contact me and I can move the projetct to you !!! Tufão - an asynchronous web

Vinícius dos Santos Oliveira 546 Aug 8, 2022
C Hypertext Library - A library for writing web applications in C

CHL C Hypertext Library - A library for writing web applications in C #include <chl/chl.h> int main() { chl_set_default_headers(); chl_print_header

null 272 Jun 20, 2022
Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows

English | 简体中文 | 繁體中文 Overview Drogon is a C++14/17-based HTTP application framework. Drogon can be used to easily build various types of web applicat

An Tao 7.8k Aug 9, 2022
Ultra-lightweight web browser based on Qt Ultralight webview, powered by Ultralight HTML renderer

Qt Ultralight Browser This is an ultra-lightweight web browser powered by the Ultralight web engine embedded in Qt 5 app as a custom webview widget -

niu tech 34 Jul 24, 2022
A webserver hosting a bank system for Minecraft, able to be used from web browser or from CC/OC if you're playing modded.

CCash A webserver hosting a bank system for Minecraft, able to be used from web browser or from CC/OC if you're playing modded. Description the curren

William Katz 24 Dec 10, 2021
A simple web browser written for learning purposes in C++

AWB: Abbix's web browser pls send help AWB is a simple web browser written for learning purposes in C++, it features a custom engine named orca render

null 9 Jul 8, 2021
Abaco: lame web browser for Plan 9

Abaco: lame web browser for Plan 9, eternally a work in progress.

Fazlul Shahriar 7 Mar 7, 2022