Xray-docs-next/docs/en/development/intro/design.md

44 lines
1.7 KiB
Markdown
Raw Normal View History

# Design Objectives
2021-05-26 11:05:53 +00:00
- Xray Kernel provides a platform that supports essential network proxy functions and can be developed upon to provide a better user experience.
- Cross-platform is the primary principle to reduce the cost of secondary development.
2021-05-26 11:05:53 +00:00
## Architecture
2021-05-26 11:05:53 +00:00
![Architecture](./framework.png)
The kernel is divided into three layers: the application layer, the proxy layer, and the transport layer.
2021-05-26 11:05:53 +00:00
Each layer contains several modules, which are independent of each other. Modules of the same type can be seamlessly replaced.
2021-05-26 11:05:53 +00:00
### Application Layer
2021-05-26 11:05:53 +00:00
The application layer contains some commonly used functions in proxy layers, which are abstracted for reuse in different proxy modules.
2021-05-26 11:05:53 +00:00
The modules at the application layer should be implemented purely in software and should not be dependent on hardware or platform-related technologies.
2021-05-26 11:05:53 +00:00
List of Important Modules:
2021-05-26 11:05:53 +00:00
- Dispatcher: Used to transfer data received by the inbound agent to the outbound agent;
- Router: Routing module, see [Routing Configuration](../../config/routing.md) for details;
- DNS: Built-in DNS server module;
- Proxy Manager: Proxy manager;
2021-05-26 11:05:53 +00:00
### Proxy Layer
2021-05-26 11:05:53 +00:00
The proxy layer is divided into two parts: Inbound Proxy and Outbound Proxy.
2021-05-26 11:05:53 +00:00
The two parts are independent of each other, where the inbound proxy does not rely on a specific outbound proxy, and vice versa.
2021-05-26 11:05:53 +00:00
#### Inbound Proxy
2021-05-26 11:05:53 +00:00
- Implement the [proxy.Inbound](https://github.com/xtls/Xray-core/blob/main/proxy/proxy.go) interface;
2021-05-26 11:05:53 +00:00
#### Outbound Proxy
2021-05-26 11:05:53 +00:00
- Implement the [proxy.Outbound](https://github.com/xtls/Xray-core/blob/main/proxy/proxy.go) interface;
2021-05-26 11:05:53 +00:00
### Transport Layer
2021-05-26 11:05:53 +00:00
2023-05-19 15:06:51 +00:00
The transport layer provides a set of tools and modules related to network data transmission.