Git Product home page Git Product logo

box_for_magisk's Introduction

Box for Magisk

id en cn

BOX
BOX

Transparent Proxy for Android(root)

android releases

This project is a Magisk module which includes clash, sing-box, v2ray and xray proxies.

Tun (tcp + udp)

open and edit /data/adb/box/settings.ini

# select the client to use : clash / sing-box / xray / v2fly
bin_name="good day"
# Proxy mode: blacklist / whitelist / tun (only tun auto-route)
proxy_mode="tun" # change to tun

sing-box config.json

  "inbounds": [
    {
      "type": "tun",
      "tag": "tun-in",
      "interface_name": "utun",
      "inet4_address": "172.19.0.1/30",
      "inet6_address": "fdfe:dcba:9876::1/126",
      "mtu": 9000,
      "stack": "system", // lwip , gvisor
      "auto_route": true,
      "strict_route": false,
      "sniff": true,
      "sniff_override_destination": true,
      "domain_strategy": "prefer_ipv4"
    }
  ],
  "route": {
    "final": "PROXY",
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
    ],
    "auto_detect_interface": true // set true,
  }

clash config.yaml

tun:
  enable: true
  # biarkan default utun
  device: utun
  mtu: 9000
  # gvisor / lwip / system
  stack: system
  dns-hijack:
    - any:53
  auto-route: true
  auto-detect-interface: true
  # end
  inet4-address: 172.19.0.1/30
  inet6-address: [fdfe:dcba:9876::1/126]

Mixed (redirec tcp + tun udp)

open and edit /data/adb/box/settings.ini

# select the client to use : clash / sing-box / xray / v2fly
bin_name="good day"
# set the port numbers for tproxy and redir
redir_port='9797'
# redirect: tcp only, / tproxy: for tcp+udp with tproxy, / mixed: mode with redirect[tcp] and tun[udp]
# Network mode: tproxy for transparent proxying
network_mode="mixed" # change to mixed
# Proxy mode: blacklist / whitelist / tun (only tun auto-route)
proxy_mode="blacklist"

sing-box config.json

  "inbounds": [
    {
      "type": "redirect",
      "tag": "redirect-in",
      "listen": "::",
      "listen_port": 9797,
      "sniff": true
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "interface_name": "utun",
      "inet4_address": "43.0.0.1/30",
      "inet6_address": "fdfe:dcba:9876::1/126",
      "mtu": 9000,
      "stack": "system", // lwip , gvisor
      "auto_route": true,
      "strict_route": false,
      "sniff": true,
      "sniff_override_destination": true,
      "domain_strategy": "prefer_ipv4"
    }
  ]
  "route": {
    "final": "PROXY",
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
    ],
    "auto_detect_interface": true // set true,
  }

clash config.yaml

redir-port: 9797

tun:
  enable: true
  # biarkan default utun
  device: utun
  mtu: 9000
  # gvisor / lwip / system
  stack: system
  dns-hijack:
    - any:53
  auto-route: true
  auto-detect-interface: true
  # end
  inet4-address: 172.19.0.1/30
  inet6-address: [fdfe:dcba:9876::1/126]

Tproxy (tcp + tun)

open and edit /data/adb/box/settings.ini

# select the client to use : clash / sing-box / xray / v2fly
bin_name="good day"
# set the port numbers for tproxy and redir
tproxy_port='9898'
# redirect: tcp only, / tproxy: for tcp+udp with tproxy, / mixed: mode with redirect[tcp] and tun[udp]
# Network mode: tproxy for transparent proxying
network_mode="tproxy" # change to tproxy
# Proxy mode: blacklist / whitelist / tun (only tun auto-route)
proxy_mode="blacklist"

sing-box config.json

  "inbounds": [
    {
      "type": "tproxy",
      "tag": "tproxy-in",
      "listen": "::",
      "listen_port": 9898,
      "sniff": true,
      "sniff_override_destination": true,
      "sniff_timeout": "300ms",
      "domain_strategy": "prefer_ipv4",
      "udp_timeout": 300
    }
  ]

clash config.yaml

tproxy-port: 9898
# tun:
# enable: false
# # biarkan default utun
# device: utun
# mtu: 9000
# # gvisor / lwip / system
# stack: system
# dns-hijack:
# - any:53
# auto-route: true
# auto-detect-interface: true
# # end
# inet4-address: 172.19.0.1/30
# inet6-address: [fdfe:dcba:9876::1/126]

xray/v2ray config.json

  "inbounds": [
    {
      "tag": "proxy-in",
      "port": 9898,
      "protocol": "dokodemo-door",
      "settings": {
        "network": "tcp,udp",
        "followRedirect": true
      },
      "streamSettings": {
        "sockopt": {
          "tproxy": "tproxy"
        }
      },
      "sniffing": {
        "enabled": true,
        "routeOnly": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ]

make sure the ports in settings.ini and configuration are in sync.

Credits

box_for_magisk's People

Contributors

taamarin avatar tearmoon avatar dependabot-preview[bot] avatar github-actions[bot] avatar renovate[bot] avatar riffchz avatar easternday avatar poweran2020 avatar actions-user avatar chadgreen01 avatar jeelsboobz avatar tw4452852 avatar cxyzzz avatar rockxsj avatar nep-timeline avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.