Skip to content

Instantly share code, notes, and snippets.

@rinex20
Last active April 27, 2022 08:13
Show Gist options
  • Save rinex20/b0542184d2dada204752cf792fcaf725 to your computer and use it in GitHub Desktop.
Save rinex20/b0542184d2dada204752cf792fcaf725 to your computer and use it in GitHub Desktop.
## v2ray config json file for intranet proxy

v2ray config json file for intranet proxy

{
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"reverse": {
"bridges": [
{
"tag": "bridge",
"domain": "office.abc.com"
}
]
},
"outbounds": [
{
"tag": "out",
"protocol": "freedom",
"settings":{
}
},
{
"tag": "interconn-ss",
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "xxx.xxxx.com",
"method": "aes-128-gcm",
"ota": false,
"password": "34790211",
"port": 5228,
"network": "tcp,udp"
}
]
}
}
],
"routing": {
"rules": [
{
"type": "field",
"inboundTag": [
"bridge"
],
"domain": [
"full:office.abc.com"
],
"outboundTag": "interconn-ss"
},
{
"type": "field",
"inboundTag": [
"bridge"
],
"outboundTag": "out"
}
]
}
}
version: '3'
services:
v2ray:
image: v2ray/official:latest
container_name: v2ray
environment:
- TZ=Asia/Shanghai
restart: always
ports:
- "12366:8088/tcp"
- "12366:8088/udp"
- "12367:8089/tcp"
- "12367:8089/udp"
- "5222:5222/tcp"
- "5231:5231/tcp"
#command: v2ray -config=/etc/v2ray/config.json
command: ["/etc/start.sh"]
volumes:
- ./etc/start.sh:/etc/start.sh
- ./etc/v2ray:/etc/v2ray
- ./logs/v2ray:/var/log/v2ray
networks:
mynetwork:
ipv4_address: 172.22.16.3
networks:
mynetwork:
external: true
{
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"reverse": {
"portals": [
{
"tag": "portal-abc",
"domain": "office.abc.com" //hk office
}
]
},
"inbounds": [
{
"tag": "device0", // HK
"port": 5230,
"protocol": "dokodemo-door",
"settings": {
"address": "192.168.90.3", //客户端内网的设备
"port": 80,
"network": "tcp"
}
},
{
"port": 5222, //hk
"tag": "interconn",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "134b53ca-b0cc-44a7-a28f-4214842c8888",
"alterId": 64
}
]
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv4"
}
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{ // 做法一:映射某一端口
"type": "field",
"inboundTag": [
"device0"
],
"outboundTag": "portal-abc"
},
{ // 做法一:映射某一端口
"type": "field",
"inboundTag": [
"interconn"
],
"domain": [
"full:office.abc.com"
],
"outboundTag": "portal-abc"
},
{ //做法二:直接访问跳板机的内网
"type": "field",
"inboundTag": [
"tunnel" //客户端C和跳板机A都通过tunnel访问公网B
],
"outboundTag": "portal-abc"
},
{
"type": "field",
"network":"tcp,udp",
"outboundTag": "direct" // 默认直连
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment