🐘 Built with PHP

High-performance server framework for PHP

Build scalable servers with forking or event-driven patterns. HTTP, SMTP, Telnet, Syslog, DHCP, and custom protocols.

Flake HTTP Server
$ php server.php
Flake Server v0.01 started
[INFO] Listening on tcp://0.0.0.0:8080
[INFO] Mode: Event-driven (libevent)
[OK] Ready to accept connections...
1000+ Concurrent Connections
7 Protocol Handlers
2 Server Patterns

Why choose Flake?

A framework designed for real-world server applications

⚡

High Performance

Event-driven mode solves the c10k problem with libevent, handling thousands of simultaneous connections efficiently.

🔄

Dual Architecture

Choose between forking (safer, isolated) or event-driven (faster, more concurrent) patterns based on your needs.

🔌

Protocol Handlers

Built-in handlers for HTTP, SMTP, Telnet, Syslog, DHCP, JSON-RPC, XML-RPC, and SOAP protocols.

🧩

Modular Design

Extend with custom handlers. The architecture separates concerns between core socket handling and protocol logic.

🔐

TLS/SSL Support

Built-in cryptographic stream support for secure connections with minimal configuration.

📊

Daemon Support

Utilities for daemonizing your server processes, with PID file management and memory controls.

Supported Protocols

Pre-built handlers for common network protocols

🌐

HTTP

Full HTTP/1.1 server with request parsing and response handling

📧

SMTP

Mail server protocol for receiving and processing emails

💻

Telnet

Interactive terminal connections with line-based input

📝

Syslog

Centralized logging server for network devices

🖧

DHCP

Dynamic host configuration protocol server

🔗

RPC

JSON-RPC, XML-RPC, and SOAP for web services

Performance Benchmarks

Real-world performance metrics using Apache Benchmark

🔱 Forking Mode
Concurrency
483
Safety
High
Isolation
Process-level

⚠️ Watch for thundering herd problem

VS
⚡ Event-Driven Mode Recommended
Concurrency
1000+
Performance
Excellent
C10K Ready
Yes

✓ Solves the c10k problem

Getting Started

Simple installation and quick start guide

1

Clone the Repository

git clone https://github.com/animeshkundu/flake.git
2

Create Your Server

<?php
require_once 'flake.php';

class MyHandler extends \Flake\Handler {
    public function Handle_Read($data) {
        $this->Write("Hello from Flake!\n");
    }
}

$core = new \Flake\Core();
$core->Listen('tcp://0.0.0.0:8080', 'MyHandler');
$core->Run();
3

Run Your Server

php server.php

Requirements

  • PHP 7.4 or higher
  • ext-sockets extension
  • ext-pcntl extension (for forking)
  • libevent extension (optional, for event-driven mode)

System Architecture

Clean, modular design for extensibility

Core Framework

Socket Listener Handler Core
↓

Protocol Handlers

HTTP SMTP Telnet Syslog DHCP
↓

Utilities

Daemon Logger Misc

Ready to build powerful servers?

Start creating high-performance network applications with Flake today.