步骤 1:安装Go语言 确保你已安装Go语言,因为Trojan是用Golang编写的。 在Mac上使用Homebrew: brew install go 在Linux上使用包管理器: sudo apt-get install golang 在Windows上: 从官方网站下载并安装Go语言。 步骤 2:下载Trojan源码 使用Git克隆Trojan的源码仓库: git clone https://github.com/trojanproxy/trojan.git 步骤 3:编译Trojan源码 进入Trojan目录并编译: cd trojan go build 这将生成一个可执行文件,通常为 trojan.exe 或对应的系统文件。 步骤 4:配置Trojan配置文件 创建或编辑配置文件 config.json: { "bind": "...:108", "socks": "...:1081", "socks_force": true, "no_local": false, "users": [ { "user": "admin", "pass": "yourpassword" } ], "log_level": "info", "log_output": true, "access_log": "access.log", "general": { "keepalive": 10, "max_connections": 100, "max_session":...
步骤 1:安装Go语言
确保你已安装Go语言,因为Trojan是用Golang编写的。
在Mac上使用Homebrew:
brew install go
在Linux上使用包管理器:
sudo apt-get install golang
在Windows上:
从官方网站下载并安装Go语言。
步骤 2:下载Trojan源码
使用Git克隆Trojan的源码仓库:
git clone https://github.com/trojanproxy/trojan.git
步骤 3:编译Trojan源码
进入Trojan目录并编译:
cd trojan go build
这将生成一个可执行文件,通常为 trojan.exe 或对应的系统文件。
步骤 4:配置Trojan配置文件
创建或编辑配置文件 config.json:
{
"bind": "...:108",
"socks": "...:1081",
"socks_force": true,
"no_local": false,
"users": [
{
"user": "admin",
"pass": "yourpassword"
}
],
"log_level": "info",
"log_output": true,
"access_log": "access.log",
"general": {
"keepalive": 10,
"max_connections": 100,
"max_session": 100,
"via": "http/1.1",
" proxy.default": "127...1:108",
" proxy.socks": "127...1:1081",
" accept مشاهدة": false,
" accept.g
相关文章







