Some checks failed
ci / test (macos-latest) (push) Has been cancelled
ci / test (ubuntu-latest) (push) Has been cancelled
ci / build-cli-cross (aarch64-unknown-linux-musl) (push) Has been cancelled
ci / build-cli-cross (arm-unknown-linux-musleabi) (push) Has been cancelled
ci / build-cli-cross (armv7-unknown-linux-musleabihf) (push) Has been cancelled
ci / build-cli-cross (i686-unknown-linux-musl) (push) Has been cancelled
ci / build-cli-cross (x86_64-pc-windows-gnu) (push) Has been cancelled
ci / build-cli-cross (x86_64-unknown-linux-musl) (push) Has been cancelled
ci / build-cli-macos (aarch64-apple-darwin) (push) Has been cancelled
ci / build-cli-macos (x86_64-apple-darwin) (push) Has been cancelled
ci / build-lib-apple (push) Has been cancelled
ci / build-lib-android (push) Has been cancelled
2.2 KiB
2.2 KiB
MPTP Usage
Overview
MPTP (Multipath Transport Protocol) combines multiple outbound paths into one logical transport channel. In Leaf, the common deployment is:
- Client side: local
socksinbound +mptpoutbound - Server side:
mptpinbound +directoutbound
Configuration
JSON Config
Client example (client.json):
{
"inbounds": [
{
"protocol": "socks",
"address": "127.0.0.1",
"port": 1086
}
],
"outbounds": [
{
"protocol": "mptp",
"settings": {
"actors": [
"direct1",
"direct2"
],
"address": "127.0.0.1",
"port": 3001
}
},
{
"protocol": "direct",
"tag": "direct1"
},
{
"protocol": "direct",
"tag": "direct2"
}
]
}
Server example (server.json):
{
"inbounds": [
{
"protocol": "mptp",
"address": "0.0.0.0",
"port": 3001
}
],
"outbounds": [
{
"protocol": "direct"
}
]
}
Key fields:
outbounds[].protocol = "mptp": enables MPTP client outboundsettings.actors: list of outbound tags used as sub-connectionssettings.address,settings.port: MPTP server address and portinbounds[].protocol = "mptp": enables MPTP server inbound listener
conf Config
MPTP outbound can also be configured in [Proxy Group]:
[Proxy Group]
MptpOutTag = mptp, actor1, actor2, actor3, address=1.2.3.4, port=10000
Running
Build:
cargo build -p leaf-cli --release
Run server:
./target/release/leaf -c server.json
Run client:
./target/release/leaf -c client.json
Validation
- Configure your app to use local SOCKS5 proxy
127.0.0.1:1086. - Start with simple connectivity checks:
curl --socks5 127.0.0.1:1086 https://example.com
- Verify configuration syntax before production startup:
./target/release/leaf -c client.json -T
./target/release/leaf -c server.json -T
Notes
actorsshould include at least two outbounds to achieve multipath aggregation.- Ensure each actor tag exists in
outbounds. - Open server listening port (for example
3001) in firewall/security group.