Skip to content

xKingDark/http-server

Repository files navigation

http-server

A simple HTTP server made using C++.

Library Usage Examples

Refer to src-examples for more examples

#include "HttpServer.hpp"

HttpServer g_Server;
int main(int argc, char* argv[])
{
    g_Server.use("/", HttpMethod::GET, [](HttpRequest request, HttpResponse& response, const NextFn& next) {
        response.setHeader("Content-Type", "text/plain");
        response.send("Hello, world!");
    });

    g_Server.listen(8080);
};

Building

  • Install CMake
  • Run build.bat, or build.sh to build this project.

If built successfully, a static library with the name web-server.lib should be found inside build/Release directory.

Features

  • WebSockets
  • Caching
  • SSL Support

License

This project is open-source under the MIT License. Feel free to modify and contribute!

Contributing

# Fork the repository
git clone https://github.com/xkingDark/http-server.git

# Create a new branch
git checkout -b feature-branch

# Commit your changes
git commit -m "Added new feature"

# Push to GitHub
git push origin feature-branch

# Submit a Pull Request

About

A simple HTTP server made using C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages