Skip to content

Commit

Permalink
various updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Mar 29, 2024
1 parent 2e32e82 commit 6efadc8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/analyzers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ only those that are needed.

This document lists the properties provided by each analyzer that can be used by rules.

!!! tip

Many analyzers do not provide all properties at once, but rather gradually add/update fields as the connection proceeds. For instance, when an HTTP connection has sent a request but has not yet received a response, the HTTP analyzer will only have the `req` part without `resp`. Each connection is checked against rules whenever at least one property changes. Rules need to be able to correctly handle cases where the needed fields are nil. (e.g., `http != nil && http.resp != nil` or using the `?` operator `http?.resp`)

## Built-in

Every connection will always have the following properties:
Expand Down
8 changes: 6 additions & 2 deletions docs/analyzers.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ hide:
- navigation
---

OpenGFW 的最主要组件之一是分析器。分析器的作用是分析连接,检查它是否是它们支持的协议,如果是,就从该连接中提取信息,为规则引擎提供属性,以便与用户提供的规则进行匹配。OpenGFW 会自动分析提供的规则中引用了哪些分析器,仅启用需要的分析器。
分析器是 OpenGFW 的重要组件之一,作用是分析连接,检查是否是支持的协议,并从该连接中提取信息,作为提供给规则引擎的属性,以便与用户提供的规则进行匹配。OpenGFW 会自动分析提供的规则中引用了哪些分析器,仅启用需要的分析器。

本文档列出了每个分析器提供的属性,这些属性可以被规则使用。
本文档列出了每个分析器提供的属性。所有列出的属性都可以在规则中使用。

!!! tip

许多分析器并非一次性提供全部属性,而是会随着传输进行逐步增加/更新字段。例如,当一个 HTTP 连接发送了请求但还没有收到响应时,HTTP 分析器只会有 `req` 部分而没有 `resp`。每个连接会在任何属性发生变化时匹配一次规则。规则需要能正确处理需要的字段为 `nil` 的情况。(如 `http != nil && http.resp != nil` 或利用 `?` 操作符 `http?.resp`)

## 内置

Expand Down
1 change: 1 addition & 0 deletions docs/build-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ hide:
### Build

```shell
export CGO_ENABLED=0
go build
```

Expand Down
1 change: 1 addition & 0 deletions docs/build-run.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ hide:
### 构建

```shell
export CGO_ENABLED=0
go build
```

Expand Down

0 comments on commit 6efadc8

Please sign in to comment.