# Web Programming Interface (WPI)

The `Web Programming Interface (WPI)` represents the backbone of the Web in Bootgly, offering an essential implementation layer for robust and scalable network and web development. This fundamental component encapsulates core building blocks such as UDP, TCP and HTTP servers and clients, plus routing-oriented HTTP capabilities, providing a solid foundation for Bootgly applications that talk over the network.

## Key Features of WPI

1. `UDP/TCP/HTTP Servers and Clients`: WPI provides implementations of UDP, TCP and HTTP servers and clients, enabling efficient communication across different protocol layers and application needs.

2. `Web Routing`: With advanced routing features, WPI facilitates the definition of endpoints and handling of HTTP requests, ensuring smooth and effective navigation through the application's resources.

3. `Connection Management`: This component offers features to manage connections with clients, handle requests and responses efficiently, and ensure a stable and responsive web experience.

4. `Integrated Security`: Incorporates security measures to protect against common web threats such as SQL injection attacks, XSS, and CSRF, thus ensuring the integrity and reliability of applications developed with the framework.

5. `Extensibility`: WPI is designed with a modular and extensible architecture, allowing for easy integration of new features and functionalities as needed.

## Benefits of WPI

- Efficient Layered Development:

By providing a common infrastructure, WPI significantly reduces the time and effort required for web development, as it isolates the lower abstraction layer that is common in the web development process, allowing separate higher abstractions to be created for more than one software architecture pattern like MVC, MVP, MVVM, etc.

- Enhanced Performance:

With its optimized implementation of TCP/HTTP servers and clients, WPI ensures exceptional performance, even under intense workloads and high-demand environments.

- Flexibility and Control:

WPI's advanced routing and connection management features give developers a high level of flexibility and control over application behavior, enabling the creation of customized and highly interactive web experiences.

- Common APIs

With Bootgly's organized infrastructure, it's possible to integrate other Server APIs (SAPIs) and maintain a common API for servers and clients, using both internal and external SAPIs.

## Components

| Component | Description |
|---|---|
| **HTTP Server CLI** | Event-driven, multi-worker HTTP server built on TCP. |
| **HTTP Client CLI** | Pure-PHP HTTP client with keep-alive, pipelining, redirects, timeouts, retries and SSL/TLS. No cURL dependency. |
| **UDP Server CLI** | Low-level UDP server for datagram handlers, worker-based execution and terminal-driven operation. |
| **UDP Client CLI** | Low-level UDP client with callback-driven send/receive flows and monitor-friendly execution. |
| **TCP Server CLI** | Low-level TCP server with `SO_REUSEPORT` and non-blocking I/O. |
| **TCP Client CLI** | Low-level TCP client with event loop integration. |
