To the trojan connection, you need
Buy a VPS with external IP address. I used a ubuntu server.
In Godaddy console panel, set A address for the
VPS IP address. Such as host.name
.
Install certbot in ubuntu
apt install certbot
Run certbot and generate certfication
certbot certonly
Note:
/etc/letsencrypt/live/
apt install nginx
Download trojan code
git clone https://github.com/p4gefau1t/trojan-go.git
Install go development environment
apt install golang
Build binary
go build -o trojan --tags "full" # go 1.17
mv trojan ~/.local/bin # add ~/.local/bin to your PATH
Prepare trojan configuration
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"your_awesome_password"
],
"ssl": {
"cert": "/etc/letsencrypt/live/host.name/fullchain.pem",
"key": "/etc/letsencrypt/live/host.name/privkey.pem"
}
}
Start trojan server
Prepare Trojan binary (copy from server or generate in local machine)
go build -tags "client" -o trojan-client # go 1.17
Prepare client configuration
{
"run_type": "client",
"local_addr": "127.0.0.1",
"local_port": 1080,
"remote_addr": "host.name",
"remote_port": 443,
"password": [
"password"
]
}
Start trojan-go client
trojan -config config.json