简易隧道流量转发配置

Mr.Bai 1,195 浏览 1

水文....
备份,方便下次直接copy

添加传入传出

传入:

Source Code
  1. {
  2. "tag": "mt-in",
  3. "port": 1234,
  4. "protocol": "mtproto",
  5. "settings": {
  6. "users": [{"secret": "abcdefg456adfa6d5a4d54a654"}]
  7. }
  8. }
复制 文本 高亮

传出并桥接:

Source Code
  1. {
  2. "tag": "mt-out",
  3. "protocol": "mtproto",
  4. "settings": {},
  5. "proxySettings": {
  6. "tag": "v-out" // 把 mt-out 的流量由 v-out 转发
  7. }
  8. }
复制 文本 高亮

添加路由

Source Code
  1. {
  2. "type": "field",
  3. "inboundTag": ["mt-in"],
  4. "outboundTag": "mt-out"
  5. }
复制 文本 高亮

配合 mtg

添加传入:

HTML
  1. {
  2. "port": 10801,
  3. "listen": "127.0.0.1",
  4. "protocol": "socks"
  5. }
运行 复制 文本 高亮

启动后使用curl工具对该配置进行测试

HTML
  1. curl https://domain.com -x socks5://127.0.0.1:10801
运行 复制 文本 高亮

mtg 配置文件中添加

HTML
  1. [network]
  2. proxies = [ "socks5://127.0.0.1:10801" ]
运行 复制 文本 高亮

完工!

发表评论 取消回复
表情 图片 链接 代码

  1. 夏日博客
    夏日博客 Lv 1

    满满的技术代码。

分享