Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions docs/config/inbound/listeners/trojan.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Trojan

```{.yaml linenums="1"}
listeners:
- name: trojan-in-1
type: trojan
port: 10819 # supports ports format, e.g., 200,302 or 200,204,401-429,501-503
listen: 0.0.0.0
# routing-mark: 0 # set routing-mark for listening socket (Linux only)
# rule: sub-rule-name1 # uses rules by default; if sub-rule is not found, uses rules directly
# proxy: proxy # if not empty, directly hands over inbound traffic to the specified proxy (if proxy is not empty, the proxy name here must be valid, otherwise an error will occur)
users:
- username: 1
password: 9d0cb9d0-964f-4ef6-897d-6c6b3ccf9e68
# ws-path: "/" # if not empty, enables websocket transport layer
# grpc-service-name: "GunService" # if not empty, enables grpc transport layer
# if the following two options are filled, enables tls (must be filled together)
certificate: ./server.crt # certificate in PEM format, or the path to the certificate
private-key: ./server.key # corresponding private key in PEM format, or the path to the private key
# the following two options are for mTLS configuration. If client-auth-type is set to "verify-if-given" or "require-and-verify", client-auth-cert must not be empty
# client-auth-type: "" # available values: "", "request", "require-any", "verify-if-given", "require-and-verify"
# client-auth-cert: string # certificate in PEM format, or the path to the certificate
# if filled, enables ECH (can be generated by `mihomo generate ech-keypair <plaintext-domain>`)
# ech-key: |
# -----BEGIN ECH KEYS-----
# ACATwY30o/RKgD6hgeQxwrSiApLaCgU+HKh7B6SUrAHaDwBD/g0APwAAIAAgHjzK
# madSJjYQIf9o1N5GXjkW4DEEeb17qMxHdwMdNnwADAABAAEAAQACAAEAAwAIdGVz
# dC5jb20AAA==
# -----END ECH KEYS-----
# shadow-tls:
# enable: true
# version: 3 # supports v1/v2/v3
# # password: shadow-tls-password # v2 configuration item
# users: # v3 configuration item
# - name: shadow-tls-user
# password: shadow-tls-password
# handshake:
# dest: [www.example.com:443](https://www.example.com:443)
# # proxy: ""
# if reality-config is filled, enables reality (note: cannot be filled simultaneously with certificate and private-key)
# reality-config:
# dest: test.com:443
# private-key: jNXHt1yRo0vDuchQlIP6Z0ZvjT3KtzVI-T4E7RoLJS0 # can be generated by `mihomo generate reality-keypair` command
# short-id:
# - 0123456789abcdef
# server-names:
# - test.com
# # the following two limits are optional, used to rate-limit fallback connections that fail verification, bytesPerSec defaults to 0 which means disabled
# # fallback rate limiting is a fingerprint feature and is not recommended; if you are a panel/one-click script developer, make sure to randomize these parameters
# limit-fallback-upload:
# after-bytes: 0 # starts rate limiting after transmitting specified bytes
# bytes-per-sec: 0 # baseline speed (bytes/second)
# burst-bytes-per-sec: 0 # burst speed (bytes/second), takes effect when greater than bytesPerSec
# limit-fallback-download:
# after-bytes: 0 # starts rate limiting after transmitting specified bytes
# bytes-per-sec: 0 # baseline speed (bytes/second)
# burst-bytes-per-sec: 0 # burst speed (bytes/second), takes effect when greater than bytesPerSec
# ss-option: # similar to the shadowsocks setting in trojan-go
# enabled: false
# method: aes-128-gcm # aes-128-gcm/aes-256-gcm/chacha20-ietf-poly1305
# password: "example"
### NOTE: For trojan listener, if "allow-insecure" is not true, at least one of "certificate and private-key" or "shadow-tls" or "jls-config" or "reality-config" or "ss-option" must be filled in ###
# allow-insecure: false # whether to allow disabling TLS encryption (NOTE: only used when upstreamed by nginx, caddy, etc.)
# mux-option:
# padding: true
# brutal:
# enabled: true
# up: 1000 # default Mbps
# down: 1000
12 changes: 11 additions & 1 deletion docs/config/inbound/listeners/trojan.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ listeners:
# madSJjYQIf9o1N5GXjkW4DEEeb17qMxHdwMdNnwADAABAAEAAQACAAEAAwAIdGVz
# dC5jb20AAA==
# -----END ECH KEYS-----
# shadow-tls:
# enable: true
# version: 3 # 支持 v1/v2/v3
# # password: shadow-tls-password # v2 配置项
# users: # v3 配置项
# - name: shadow-tls-user
# password: shadow-tls-password
# handshake:
# dest: www.example.com:443
# # proxy: ""
# 如果填写reality-config则开启reality(注意不可与certificate和private-key同时填写)
# reality-config:
# dest: test.com:443
Expand All @@ -49,7 +59,7 @@ listeners:
# enabled: false
# method: aes-128-gcm # aes-128-gcm/aes-256-gcm/chacha20-ietf-poly1305
# password: "example"
### 注意,对于trojan listener, 如果 "allow-insecure" 不为 true, 至少需要填写 “certificate和private-key” 或 “reality-config” 或 “ss-option” 的其中一项 ###
### 注意,对于trojan listener, 如果 "allow-insecure" 不为 true, 至少需要填写 “certificate和private-key” 或 “shadow-tls” 或 “jls-config” 或 “reality-config” 或 “ss-option” 的其中一项 ###
# allow-insecure: false # 是否允许不开启tls加密(注意:仅用于有 nginx, caddy 前置的情况)
# mux-option:
# padding: true
Expand Down
12 changes: 11 additions & 1 deletion docs/config/inbound/listeners/trojan.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ listeners:
# madSJjYQIf9o1N5GXjkW4DEEeb17qMxHdwMdNnwADAABAAEAAQACAAEAAwAIdGVz
# dC5jb20AAA==
# -----END ECH KEYS-----
# shadow-tls:
# enable: true
# version: 3 # поддерживает v1/v2/v3
# # password: shadow-tls-password # параметр конфигурации v2
# users: # параметр конфигурации v3
# - name: shadow-tls-user
# password: shadow-tls-password
# handshake:
# dest: www.example.com:443
# # proxy: ""
# если заполнен reality-config, то включается reality (не может использоваться одновременно с certificate и private-key)
# reality-config:
# dest: test.com:443
Expand All @@ -49,7 +59,7 @@ listeners:
# enabled: false
# method: aes-128-gcm # aes-128-gcm/aes-256-gcm/chacha20-ietf-poly1305
# password: "example"
### Обратите внимание, что для троянских программ, если параметр "allow-insecure" не равен true, необходимо заполнить хотя бы одно из следующих полей: "certificate and private-key", "reality-config" или "ss-option". ###
### ВНИМАНИЕ: Для слушателя trojan, если "allow-insecure" не равен true, необходимо заполнить как минимум одну из опций: "certificate" и "private-key" или "shadow-tls" или "jls-config" или "reality-config" или "ss-option" ###
# allow-insecure: false # Разрешить ли отключение шифрования TLS (Примечание: только в случаях, когда nginx или caddy установлены предварительно)
# mux-option:
# padding: true
Expand Down