bfe

command module
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ¶

BFE

GitHub Travis Go Report Card GoDoc Snap Status CII Best Practices FOSSA Status Slack Widget

English | äø­ę–‡

BFE (Beyond Front End) is a modern layer 7 load balancer from baidu.

bfe logo

BFE is a Cloud Native Computing Foundation (CNCF) sandbox project.

cncf-logo

Introduction

BFE opensource project includes several components, which can be used together as a integrated layer 7 load balancer and traffic management solution.

BFE system consists of data plane and control plane:

  • Data plane:responsible for forwarding user's traffic, including below component:
    • BFE Server:BFE forward engine (this repository, bfenetworks/bfe). BFE Server performs content based routing, load balancing and forwards the traffic to backend servers.
  • Control plane:responsible for management and configuration of BFE system, including below components:
    • API-Server:provides API and handles update, storage and generation of BFE config
    • Conf-Agent:component for loading config, fetches latest config from API-Server and triggers BFE Server to reload it
    • Dashboard:provides a graphic interface for user to manage and view major config of BFE

Refer to Overview in BFE document for more information

Besides, we also implement BFE Ingress Controller based on BFE, to fulfill Ingress in Kubernetes

šŸš€ Quick Start

This quick start is for users who want to get a running setup fast: build Docker images first, then deploy the Kubernetes example.

1) Build Docker images

From the repository root:

make docker

Notes:

  • make docker builds both prod and debug images. Image tags are derived from the VERSION file.
  • To override the image name, set BFE_IMAGE_NAME, for example:
make docker BFE_IMAGE_NAME=your-registry/bfe

If you want the Kubernetes deployment to use your locally built image, push it to a registry reachable by your cluster nodes (or load it into a local cluster), then update the bfe image mapping under images: in examples/kubernetes/kustomization.yaml.

For more details on building and pushing images (including make docker-push), see:

2) Deploy via Kubernetes example (kustomize)
cd examples/kubernetes
kubectl apply -k .
kubectl apply -f whoami-deploy.yaml

For details (image mirror settings, initialization notes, cleanup and finalizer troubleshooting, etc.), see:

Advantages

  • Multiple protocols supported, including HTTP, HTTPS, SPDY, HTTP2, WebSocket, TLS, FastCGI, etc.
  • Content based routing, support user-defined routing rule in advanced domain-specific language.
  • Support multiple load balancing policies.
  • Flexible plugin framework to extend functionality. Based on the framework, developer can add new features rapidly.
  • Efficient, easy and centralized management, with RESTful API and Dashboard support.
  • Detailed built-in metrics available for service status monitor.

Getting Started

Running the tests

Documentation

Book

  • In-depth Understanding of BFE (Released in Feb 2023)

    This book focuses on BFE open source project, introduces the relevant technical principles of network access, explains the design idea of BFE open source software, and how to build a network front-end platform based on BFE open source software. Readers with development capabilities can also develop BFE extension modules according to their own needs or contribute code to BFE open source projects according to the instructions in this book.

Contributing

  • Please create an issue in issue list.
  • Contact Committers/Owners for further discussion if needed.
  • Following the golang coding standards.
  • See the CONTRIBUTING file for details.

Authors

Communication

  • BFE community on Slack: Sign up CNCF Slack and join bfe channel.
  • BFE developer group on WeChat: Send a request mail with your WeChat ID and a contribution you've made to BFE(such as a PR/Issue). We will invite you right away.

License

BFE is under the Apache 2.0 license. See the LICENSE file for details.

Documentation ¶

The Go Gopher

There is no documentation for this package.

Directories ¶

Path Synopsis
action
action_variable.go - variable name legality check and variable handlers
action_variable.go - variable name legality check and variable handlers
Package bfe_bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
Package bfe_bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
bfe_config
Package bfe_http2 implements the HTTP/2 protocol.
Package bfe_http2 implements the HTTP/2 protocol.
hpack
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
Package bfe_model_protocol hosts the per-protocol (model_protocol) adapters that carry all protocol knowledge of the AI gateway: auth header injection, supplementary headers (e.g.
Package bfe_model_protocol hosts the per-protocol (model_protocol) adapters that carry all protocol knowledge of the AI gateway: auth header injection, supplementary headers (e.g.
anthropic
Package anthropic implements the model_protocol adapter for the Anthropic (Claude) protocol.
Package anthropic implements the model_protocol adapter for the Anthropic (Claude) protocol.
gemini
Package gemini implements the model_protocol adapter for the Google Gemini protocol (generateContent / streamGenerateContent).
Package gemini implements the model_protocol adapter for the Google Gemini protocol (generateContent / streamGenerateContent).
openai
Package openai implements the model_protocol adapter for the OpenAI protocol family (OpenAI chat/completions, DeepSeek, Groq and the OpenAI Responses API).
Package openai implements the model_protocol adapter for the OpenAI protocol family (OpenAI chat/completions, DeepSeek, Groq and the OpenAI Responses API).
utils
Package utils holds protocol-neutral helpers shared by the model-protocol adapters: protocol name constants, the neutral usage result structure, upstream-error normalization types and the gjson usage extraction chains.
Package utils holds protocol-neutral helpers shared by the model-protocol adapters: protocol name constants, the neutral usage result structure, upstream-error normalization types and the gjson usage extraction chains.
mod_ai_batch
Package mod_ai_batch implements OpenAI Batch API (/v1/files, /v1/batches) passthrough support: operation classification, upload line/byte counting, response field extraction, batch-level key affinity bindings, and the reserve/settle/release orchestration of post-paid batch quota.
Package mod_ai_batch implements OpenAI Batch API (/v1/files, /v1/batches) passthrough support: operation classification, upload line/byte counting, response field extraction, batch-level key affinity bindings, and the reserve/settle/release orchestration of post-paid batch quota.
mod_ai_cache/provider/embedding
Package embedding abstracts the text embedding service used by the semantic cache of mod_ai_cache.
Package embedding abstracts the text embedding service used by the semantic cache of mod_ai_cache.
mod_ai_cache/provider/vector
Package vector abstracts the vector store used by the semantic cache of mod_ai_cache.
Package vector abstracts the vector store used by the semantic cache of mod_ai_cache.
mod_traffic_mirror
Package mod_traffic_mirror implements traffic mirroring (shadow traffic): while the gateway forwards a request to its production upstream, an asynchronous copy is sent to a mirror target cluster.
Package mod_traffic_mirror implements traffic mirroring (shadow traffic): while the gateway forwards a request to its production upstream, an asynchronous copy is sent to a mirror target cluster.
mod_userid
Package mod_userid generate user identity to trace one user in different request this mod will auto set user id for request if user id not exited in cookie to cookie
Package mod_userid generate user identity to trace one user in different request this mod will auto set user id for request if user id not exited in cookie to cookie
bfe_net
textproto
Package textproto implements generic support for text-based request/response protocols in the style of HTTP, NNTP, and SMTP.
Package textproto implements generic support for text-based request/response protocols in the style of HTTP, NNTP, and SMTP.
Package bfe_proxy implements Proxy Protocol (v1 and v2) parser and writer, as per specification: http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
Package bfe_proxy implements Proxy Protocol (v1 and v2) parser and writer, as per specification: http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
trie
Package trie implements a simple trie data structure that maps "paths" (which are slices of strings) to arbitrary data values (type interface{}).
Package trie implements a simple trie data structure that maps "paths" (which are slices of strings) to arbitrary data values (type interface{}).
bns
crypto
Package crypto implements decrypt-only support for the field-level encrypted config values produced by the control plane at export time (see docs/zh_cn/sys_design/config_file_field_encryption.md).
Package crypto implements decrypt-only support for the field-level encrypted config values produced by the control plane at export time (see docs/zh_cn/sys_design/config_file_field_encryption.md).
epp
murmur3
Native (and fast) implementation of Austin Appleby's MurmurHash3.
Native (and fast) implementation of Austin Appleby's MurmurHash3.
abi
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL