Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos xray v2ray tproxy redir redirect mode with /dev/pf #44

Open
fbion opened this issue Sep 6, 2023 · 0 comments
Open

macos xray v2ray tproxy redir redirect mode with /dev/pf #44

fbion opened this issue Sep 6, 2023 · 0 comments

Comments

@fbion
Copy link
Owner

fbion commented Sep 6, 2023

XTLS/Xray-core@59602db
XTLS/Xray-core#1186
https://github.com/XTLS/Xray-core/blob/f7c20b85dcbd6c2e8acf2589dfaef8a448daf337/transport/internet/sockopt_darwin.go#L34

pf.json

{
"log": {
"access": "a.log",
"error": "e.log",
"loglevel": "debug"
},
"inbounds": [
{

  "port": 12345,
  "protocol": "dokodemo-door",
  "tag": "dokodemo",
  "settings": {
    "network": "tcp",
    "followRedirect": true
  },
  "sniffing": {
     "enabled": true,
     "destOverride": ["http", "tls"]
  },
  "streamSettings": {
    "sockopt": {
      "tproxy": "Redirect"
    }
  }
}

],

"outbounds": [
{
"protocol": "socks",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 1080
}
]
}

}

]

}

pf.conf

lo = "lo0"
dev = "en0"

rdr log on lo0 inet proto tcp from {$dev} to any port 1:65535 -> 127.0.0.1 port 12345

pass out log on $dev route-to $lo inet proto tcp from {$dev} to any port 443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant