guardianproject / orbot-apple

Orbot VPN app for iOS
MIT License
205 stars 34 forks source link

Strip unwanted leaf features #6

Closed eycorsican closed 2 years ago

eycorsican commented 2 years ago

The default feature set included in leaf contains a lot features, e.g. SSL, crypto, QUIC, Websocket, that have no use in this project. According to the config template, the minimal feature set could look like,

default = [
    "leaf/config-conf",
    "leaf/inbound-tun",
    "leaf/inbound-socks",
    "leaf/outbound-socks",
    "leaf/outbound-redirect",
    "leaf/outbound-direct",
    "leaf/outbound-drop"
]

This gives a much smaller binary.

It may need our own leaf-ffi-orbot library for doing so, just as how leaf-ffi does.

tladesignz commented 2 years ago

@eycorsican, thank you so much for your input!

@bitmold, have a look at my changes!

In a quick experiment, I could reduce libleaf.a for aarch64-apple-ios from 43.2 MB to 25.9 MB!