Skip to content

Commit

Permalink
add: trojan complete example
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmark authored and xiaokangwang committed Sep 2, 2024
1 parent 17924f6 commit 10f5ec3
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/en_US/v5/config/protocol/server_spec.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## ServerEndpointObject

### Structure

```json
{
"address": "",
"port": 0,
"user": []
}
```

### Fields

> `address`: string
> `port`: uint32
Expand Down
19 changes: 19 additions & 0 deletions docs/en_US/v5/config/protocol/user.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
## UserObject

### Structure

```json
{
"level": 0,
"email": "",
"account": {
{
"@type": "v2ray.core.proxy.trojan.Account",
"password": ""
}
}
}
```

### Fields

> `level`: uint32
> `email`: string
> `account`: {}
User account, see `AccountObject` under each protocol

- trojan [AccountObject](../proxy/trojan.md#accountobject)
68 changes: 68 additions & 0 deletions docs/en_US/v5/config/proxy/trojan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ Trojan is designed to operate in correctly configured TLS connections, as it doe
* Type: Inbound Protocol
* ID: `inbound.trojan`

### Structure

```json
{
"users": [],
"packetEncoding": "None"
}
```

### Fields

> `users` : [string]
A set of recognized password for this inbound.
Expand All @@ -29,6 +40,18 @@ This UDP behaviour is also known as FullCone or NAT1.
* Type: Outbound Protocol
* ID: `outbound.trojan`

### Structure

```json
{
"address": "",
"port": 0,
"password": ""
}
```

### Fields

> `address`: string
The server address. Both IP and domain name is supported.
Expand All @@ -45,6 +68,18 @@ A password recognized by server.

* Name: `#v2ray.core.proxy.trojan.ServerConfig`

### Structure

```json
{
"users": [],
"packetEncoding": "None",
"fallbacks": []
}
```

### Fields

> `users`: [[UserObject](../protocol/user.md#user)]
> `packetEncoding`: \["None" | "Packet"\]
Expand All @@ -55,16 +90,49 @@ A password recognized by server.

* Name: `#v2ray.core.proxy.trojan.ClientConfig`

### Structure

```json
{
"server": []
}
```

> `server`: [[ServerEndpoint](../protocol/server_spec.md#serverendpoint)]
## AccountObject

### Structure

```json
{
"@type": "v2ray.core.proxy.trojan.Account",
"password": ""
}
```

### Fields

> `@type`: "v2ray.core.proxy.trojan.Account"
> `password`: string
## FallbackObject

### Structure

```json
{
"alpn": "",
"path": "",
"type": "",
"dest": "",
"xver": 0
}
```

### Fields

> `alpn`: string
> `path`: string
Expand Down
12 changes: 12 additions & 0 deletions docs/v5/config/protocol/server_spec.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## ServerEndpointObject

### Structure

```json
{
"address": "",
"port": 0,
"user": []
}
```

### Fields

> `address`: string
> `port`: uint32
Expand Down
14 changes: 14 additions & 0 deletions docs/v5/config/protocol/user.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
## UserObject

### 结构

```json
{
"level": 0,
"email": "",
"account": {}
}
```

### 字段

> `level`: uint32
> `email`: string
> `account`: {}
用户账户,参具体协议对应的AccountObject

- trojan [AccountObject](../proxy/trojan.md#accountobject)
58 changes: 58 additions & 0 deletions docs/v5/config/proxy/trojan.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Trojan 被设计工作在正确配置的加密 TLS 隧道中。

* 协议名称: `trojan`

### 结构

```json
{
"users": [],
"packetEncoding": "None"
}
```

### 字段

> `users` : [string]
一组服务器认可用户的密码。
Expand All @@ -22,6 +33,18 @@ UDP 包编码方式,默认值为 `None`。(v5.4.0+)

* 协议名称: `trojan`

### 结构

```json
{
"address": "",
"port": 0,
"password": ""
}
```

### 字段

> `address`: string
服务器地址,支持 IP 地址或者域名。
Expand All @@ -38,6 +61,16 @@ UDP 包编码方式,默认值为 `None`。(v5.4.0+)

* 协议名称: `#v2ray.core.proxy.trojan.ServerConfig`

### 结构

```json
{
"server": []
}
```

### 字段

> `users`: [[UserObject](../protocol/user.md#userobject)]
> `packetEncoding`: \["None" | "Packet"\]
Expand All @@ -52,12 +85,37 @@ UDP 包编码方式,默认值为 `None`。(v5.4.0+)
## AccountObject

### 结构

```json
{
"@type": "v2ray.core.proxy.trojan.Account",
"password": ""
}
```

### 字段

> `@type`: "v2ray.core.proxy.trojan.Account"
> `password`: string
## FallbackObject

### 结构

```json
{
"alpn": "",
"path": "",
"type": "",
"dest": "",
"xver": 0
}
```

### 字段

> `alpn`: string
> `path`: string
Expand Down

0 comments on commit 10f5ec3

Please sign in to comment.