Closed mimi89999 closed 3 years ago
in case you talk about the auth-once mode, you could implement this functionality easily with a tiny shell script wrapper:
/bin/microsocks-authed
#!/bin/sh
MICROSOCKS=microsocks
user=foo
pass=bar
ip=127.0.0.1
port=1081
auth_once_delayed() {
sleep 1
curl --socks5 ${user}:${pass}@${ip}:${port} http://ifconfig.me
}
auth_once_delayed &
exec $MICROSOCKS -1 -i $ip -p $port -u "$user" -P "$pass"
if you don't want to hardcode user, pass, etc you could add a small getopt loop that parses same parameter as microsocks
The problem is that I can't run shell scripts on the device. I worked it around by adding
@@ -416,6 +423,9 @@ int main(int argc, char** argv) {
return usage();
}
}
+ union sockaddr_union whitelist_addr = {.v4.sin_family = AF_UNSPEC};
+ resolve_sa("MY_IP", 0, &whitelist_addr);
+ add_auth_ip(&whitelist_addr);
if((auth_user && !auth_pass) || (!auth_user && auth_pass)) {
dprintf(2, "error: user and pass must be used together\n");
return 1;
nice work. the code of microsocks is deliberately kept simple and readable so users can easily change it to suit their specific usecase.
I think that it's a useful feature that could be used by other users
maybe. if i get more requests for it in the future i'll consider implementing it. time will tell whether there's a real demand.
I see this got added... I am assuming use it like this:
microsocks -1 -i 0.0.0.0 -p 1080 -w 192.168.1.40 -u user -P password
assuming that is correct, can you specify more than one ip for the whitelist parameter?
Thank you for this software!
EDIT: I assumed wrong, I must not be using the -w feature correctly
Hello, It would be very useful to be able to pass IP addresses that should be whitelisted as arguments.