-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature request: lifecycle hooks for sslocal #1275
Comments
I could understand your situation. PreStart, PostStart, PreExit, PostExit hooks could be done easily by wrapping
Hmm, this would be a lot more complicated. Just a quick thought:
shadowsocks-rust/crates/shadowsocks/src/net/tcp.rs Lines 48 to 65 in a8955d2
What would be the best way to implement hooks?
It looks very complicated. I don't know if there is any other more elegant ways. |
well, kind of easily. You typically would like to set gateway rule before sslocal start (to let it connect). Then routing all traffic to TUN after it starts (otherwise you missing TUN interface yet). So it takes some gymnastics to run sslocal in background, propagiting kill signals, e.t.c. Not a rocket science but can be simpler :) I can't advise on how to do it best with codebase, haven't really dig it. But i think spawning shell process will be most flexible. I also don't think you should care much whether it's blocking or not, because it's for local client only - only affects user who doing it. If you do something slow - that's fine, it affects only you, you can change it back or whatever. |
mari12231 |
Hey guys, may i request small feature. In a vein of openvpn or wireguard, will it be possible to have:
PreStart, PostStart, PreExit, PostExit hooks (may be others) for sslocal ?
Just arbitrary shell commands to execute before/after establishing/terminating connection to remote ssserver.
Will make routing tables setup so much simpler for local-tun feature.
Will greatly appreciate.
The text was updated successfully, but these errors were encountered: