V2Fly.orgV2Fly.org
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
  • Developer Guide

    • The first step: learn to compile
    • Step 2: Understand the architecture
      • Objectives
      • Architecture
      • Application layer
      • Proxy layer
        • Inbound proxy
        • Outbound proxy
      • Transport layer
    • Step 3: Start development
    • Release Archive
    • Release Signing
  • Protocol Details

    • VMess protocol
    • mKCP Protocol
    • Mux.Cool Protocol

Step 2: Understand the architecture

This article describes the design ideas of the V2Ray core (v2ray-core).

Objectives

  • The V2Ray kernel provides a platform that supports the necessary network proxy functions, on top of which can be further developed to provide a better user experience;
  • Take cross-platform as the primary principle to reduce the cost of secondary development;

Architecture

Architecture

The kernel is divided into three layers: application layer, agent layer and transport layer. Each layer contains several modules, which are independent of each other, and modules of the same type can be replaced seamlessly.

Application layer

The application layer contains some commonly used functions in the proxy layer, which are abstracted out for reuse in different proxy modules. The modules of the application layer should be realized by pure software, and have nothing to do with hardware or platform-related technology.

List of important modules:

  • Dispatcher: Used to transfer the data received by the inbound agent to the station agent;
  • Router: Built-in routing, see Routing Configuration;
  • DNS: built-in DNS cache;
  • Proxy Manager: Inbound proxy manager;

Proxy layer

The proxy layer is divided into two parts: Inbound Proxy and Outbound Proxy. The two parts are independent of each other, the inbound agent does not depend on a specific outbound agent, and vice versa.

Inbound proxy

  • Implement proxy.Inbound interface;

Outbound proxy

  • Realize the proxy.Outbound interface;

Transport layer

The transport layer provides some tool modules related to network data transmission.

Edit this page on GitHub
Last Updated:
Contributors: transifex-integration[bot]
Prev
The first step: learn to compile
Next
Step 3: Start development