v2ray & Trojan Deployment
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, linux, nginx, raspberry-pi
- Domain
- devops, documentation, networking
Research direction
The issue names no repository file, test, or entry point; first inspect the repository's contribution and documentation structure to find where deployment tips belong. Confirm the proposed V2Ray and Trojan instructions, links, platform coverage, and configuration examples are suitable for the project before adding the guide.
Written by the indexing model from the issue text.
Description
1.服务端一键安装
https://malagege.github.io/blog/2021/03/28/%E5%9C%A8-Raspberry-Pi-%E5%BB%BA%E7%BD%AE-V2ray/
https://uzbox.com/v2raydown.html
bash <(curl -sL https://raw.githubusercontent.com/hiifeng/v2ray/main/install_v2ray.sh)
2.使用 Docker 来部署 V2Ray Server
https://malagege.github.io/blog/2021/03/28/%E5%9C%A8-Raspberry-Pi-%E5%BB%BA%E7%BD%AE-V2ray/
https://github.com/alphacodinghub/v2ray-nginx-docker
3.Trojan docker 服务端搭建(支持 Arm64, Arm64v8,RPI 4B 是 Arm64v8):
https://hub.docker.com/r/teddysun/trojan
4.Linux 客户端
linux 客户端安装(树莓派通用):
https://github.com/v2fly/fhs-install-v2ray
https://dm116.github.io/2020/04/01/configuration-of-v2ray-client-and-server-with-cdn/
https://programmer.ink/think/linux-raspberry-pie-installation-v2ray-client.html
curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
chmod +x install-release.sh
###指定局域网代理来安装 Linux 客户端:
./install-release.sh -p http://192.168.1.20:7890
在 PC(或手机)中,配置 V2Ray 客户端:
vim /usr/local/etc/v2ray/config.json
{
"log": {
"loglevel": "warning",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
// in
"inbounds": [
{
"port": 1081,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth",
"udp": true
}
},
{
"port": 1080,
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth",
"udp": false
}
}
],
// out
"outbounds": [
{
"tag":"proxy",
"protocol":"vmess",
"settings": {
"vnext": [
{
"address": "myvmserver.com",
"port": 443,
"users": [
{
"id": "xxxx-43bd-4749-bd60-xxxx",
"alterId": 16
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"path": "/serverpath"
}
},
"mux": {
"enabled": true
}
},
{
"protocol": "freedom",
"settings":{},
"tag": "direct"
},
{
"protocol": "blackhole",
"settings":{},
"tag": "adblock"
}
],
// route
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"outboundTag": "adblock",
"domain": [
"tanx.com",
"googeadsserving.cn",
"baidu.com"
]
},
{
"type": "field",
"outboundTag": "direct",
"ip": [
"geoip:cn", // 中国大陆的 IP
"geoip:private" // 私有地址 IP,如路由器等
]
},
{
"type": "field",
"outboundTag": "direct",
"domain": [
"geosite:cn", // 中国大陆主流网站的域名
"domain:baidu.com",
"domain:taobao.com",
"domain:aliyun.com",
"domain:zhihu.com",
"domain:cnblogs.com",
"domain:runoob.com",
"domain:freebuf.com",
"domain:mozilla.org",
"domain:csdn.net",
"domain:jd.com"
]
}
]
}
}
启动服务
systemctl enable v2ray; systemctl start v2ray
上述配置要更改的地方是你的 vmess 服务器 address,id, alterId, wsSettings 里面的 path。上述配置会把除局域网(比如访问路由器)以外的所有流量转发至你的服务器。
在 Windows 和 macOS 中,配置文件通常是 V2Ray 同目录下的 config.json 文件。直接运行 v2ray 或 v2ray.exe 即可。
在 Linux 中,配置文件通常位于 /etc/v2ray/ 或 /usr/local/etc/v2ray/ 目录下。运行 v2ray --config=/etc/v2ray/config.json,或使用 systemd 等工具将 V2Ray 作为服务在后台运行。
更多详细的说明可以参考 配置文档 和 新白话文指南 .
验证 Proxy 是否工作(12.34.56.74 为 v2ray server地址):
$ curl -sSx socks5h://127.0.0.1:1081 http://ifconfig.co
12.34.56.78
$ curl -sSx http://127.0.0.1:1080 http://ifconfig.co
12.34.56.78
$ curl https://www.google.com
如果出现这个错误, 检测服务器端的 SSL 证书是否过期。
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx
5.Mac ClashX 客户端配置
新版语法
# VMess
- name: "v2ray"
type: vmess
server: xx.xx.xx.yy
port: 443
uuid: zzzzzzz-tttt-zzzz-xxxxxx-xxxxxxx
alterId: 16
cipher: auto
udp: true
tls: true
skip-cert-verify: true
# tls-hostname: myvmserver.com
network: ws
ws-opts:
path: /serverpath
headers:
Host: myvmserver.com
6.VLESS 一键安装
bash <(curl -sL https://raw.githubusercontent.com/hiifeng/v2ray/main/install_v2ray.sh)
7.V2rayU 客户端 的 vless + TLS + WS 配置
在 V2rayU 的配置里面,粘贴 json 配置,更改其中的 domain_name 为 vless 服务器域名, id 为 uuid, ws 的 path 为服务端路径即可。
{
"inbounds": [
{
"port": 1080,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 1090,
"listen": "127.0.0.1",
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth",
"udp": false
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "domain_name.com",
"port": 443,
"users": [
{
"id": "xxxx-b5f2-4641-bdc0-xxxx",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"tlsSettings": {
"serverName": "domain_name.com"
},
"wsSettings": {
"path": "/xxx"
}
}
}
]
}
同时配置 HTTP/Socket 的本地代理:
https://iitii.github.io/2020/02/04/1/
8.VMess 客户端 JSON 配置 (For Linux host v2ray, V2RayU on Mac/Linux)
https://dm116.github.io/2020/04/01/configuration-of-v2ray-client-and-server-with-cdn/
{
"log": {
"error": "",
"loglevel": "info",
"access": ""
},
"inbounds": [
{
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": false,
"auth": "noauth"
},
"port": "7890"
},
{
"listen": "127.0.0.1",
"protocol": "http",
"settings": {
"timeout": 360
},
"port": "1090"
}
],
"outbounds": [
{
"mux": {
"enabled": false,
"concurrency": 8
},
"protocol": "vmess",
"streamSettings": {
"wsSettings": {
"path": "/xxxxxxxx",
"headers": {
"host": ""
}
},
"tlsSettings": {
"allowInsecure": false
},
"security": "tls",
"network": "ws"
},
"tag": "proxy",
"settings": {
"vnext": [
{
"address": "xxx.com",
"users": [
{
"id": "xxx-43bd-xxxx-bd60-xxx",
"alterId": 0,
"level": 0,
"security": "auto"
}
],
"port": 443
}
]
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP",
"userLevel": 0
}
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"response": {
"type": "none"
}
}
}
],
"dns": {},
"routing": {
"settings": {
"domainStrategy": "AsIs",
"rules": []
}
},
"transport": {}
}
- Dominant language
- Python
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from davideuler/programming-tips
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
build milvus on Mac Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in davideuler/programming-tips
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·