GithubHelp home page GithubHelp logo

nesjett / simplest-http-sockets Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 114 KB

Simple http server + client using sockets. Developed for learning porpourses.

Home Page: https://nesjett.github.io/simplest-http-sockets/

C 60.96% HTML 8.79% CSS 29.45% Shell 0.79%
sockets http-server http-client http-protocol http-c-server learning-http

simplest-http-sockets's Introduction

Very simple HTTP server & client

This project is intended as an example for those who want to learn how HTTP protocol works in both, client and server software, from the very basics to a more advanced handling.

AUTHOR WEBSITE

You can find more about the author, this and other of his projects at Nestor Sabater's Portfolio


It's developed in C, keeping in mind the readability as priority.

The project is not production ready and can be improved in many ways, from better encapsulation to better security algorithms, but as mentioned, It aims to provide a starting point for those willing to learn.

This repository IS NOT using any 3rd party libraries, everything is made simple enought to work and be understandable

Image of Server Running

Features

Easy server configuration

Use of a configuration file Server configuration

Realtime records

Colored connection records for testing and debugging Colore real time console

Logs

Two log files to record all server requests and errors Access log Error log

Project structure

  • server/bin
    • Contains all executables for server and for client
  • server/config
    • Contains configuration files for server. This files are used to configure different parameters in the server.
  • server/default_responses
    • Contains the default html response pages, if not provided in the website we want to access.(500, 404, ...)
  • server/public_html
    • Contains the publicly accesible site files for the server. Ex: index.html, myWebsite.html, etc.
  • server/logs
    • Contains the log files for access and errors.
  • src
    • Contains all .c y .h files, to get a cleaner code but keeping it readable for begginers.

How to use

To compile: gcc -o ../server/bin/mi_http server.c config_manager.c colors.h constants.h log_manager.c header_manager.c
To execute client: ./client [ip/host] [port] [file]
To execute server: ./server

simplest-http-sockets's People

Contributors

nesjett avatar

Stargazers

 avatar

Watchers

 avatar  avatar

simplest-http-sockets's Issues

Log cleaning

Would be good to add a config param to tell server every how many time a log registry should be cleant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.