📄️ Static File Service
Learn how to configure and use static file services in the GoFrame framework, including setting up static file directories, enabling static file service conditions, mapping URIs to static directories, customizing URI rewrite rules, and cross-origin configuration examples, to help developers effectively manage and optimize static resource access in their projects.
📄️ Logging
Using the GoFrame framework for service log management, including the configuration and usage of access logs and error logs. It explains in detail the log configuration objects and attributes, such as Logger, LogPath, ErrorStack, etc., and provides detailed explanations of log formats and custom log handling methods. Additionally, it covers how to set up logs through configuration files and code methods, and provides examples of log formats and error log recording.
📄️ HTTPS & TLS
Build an HTTPS service using the GoFrame framework, including preparation, example code, and how to obtain a free SSL certificate via Let's Encrypt. Additionally, it discusses methods to support both HTTP and HTTPS access protocols under the same WebServer, ensuring your application is more secure.
📄️ Graceful Restart
Enable and manage graceful restart features while using the GoFrame framework. This feature allows the WebServer to update or restart without interrupting existing requests, improving service stability and user experience. It supports graceful restart on *nix systems and complete restart on Windows systems, and provides management methods via web and command line. It also demonstrates specific usage examples, including basic usage, HTTPS support, and smooth management in multi-service and multi-port scenarios.
📄️ CORS
Handling CORS cross-domain requests using the GoFrame framework, setting cross-domain rules with routing management and middleware, allowing WebSocket cross-domain access. Provides CORS object and its configuration parameters, including default and restricted Origin settings. Additionally, it demonstrates basic usage methods, authorizing cross-domain Origin, and custom detection methods to achieve more flexible cross-domain request management.
📄️ CSRF
Explains how to protect web application security through CSRF defense settings in the GoFrame framework. We will introduce the use of token verification mechanisms and implement plugin-based protection through middleware. Includes installation and configuration of plugins, as well as key steps and code examples for front-end integration to help developers effectively resist CSRF attacks.
📄️ HOOK Callbacks
The HOOK event callback function provided by the ghttp.Server in the GoFrame framework, similar to middleware, allows custom event listening and handling. Event callbacks can be registered in a specific order to determine the callback invocation priority. This document provides a detailed explanation of the usage, application in API authentication control, cross-origin request handling, and showcases with example code the execution method and priority mechanism of event callbacks.
📄️ WebSocket
Developing WebSocket services using the GoFrame framework, including HTML5 clients, WebSocket server, HTTPS support, and security validation. The example code demonstrates the connection and message transmission mechanism of WebSocket, and provides a detailed explanation of the communication process and data handling methods between the server and client, enabling readers to quickly get started and implement a fully functional WebSocket service.
📄️ Status Code Handling
Implement custom status code handling in the GoFrame framework. By using the BindStatusHandler method, developers can customize handling for specified status codes such as 404, 403, 500 for a WebServer, including displaying custom error messages or page content, and implementing error page redirection. Sample code demonstrates basic settings and batch status code handling.
📄️ PProf Performance Analysis
Utilizing the pprof tool for performance analysis in a Web Server built with the GoFrame framework. The GoFrame framework integrates pprof, allowing for easy activation of performance analysis through the EnablePProf method. It also explores how to set up an independent PProf Server to effectively monitor key metrics such as memory usage, goroutine behavior, and CPU performance. The document provides concrete command line examples and analysis.
📄️ SameSite
Set the SameSite attribute in servers built with the GoFrame framework. Through detailed code examples, you can learn how to configure SameSite to ensure cookie security, especially when dealing with cross-site requests of different protocols in Chrome 89 and later versions.
📄️ HTTPServer - Metrics
This document introduces how to enable the monitoring metrics feature of the HTTP Server in the GoFrame framework, providing a detailed list of metrics and attributes to help users monitor and optimize HTTP server performance. By enabling the metric feature, you can track key performance indicators such as request execution time, total requests, and byte size transmitted.