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
Support multiple server addresses correctly in ss-local #942
Comments
I prefer to adding a |
I don't really get that. |
Running multiple ss-local instances like this:
It means to connect IPv4 and IPv6 addresses separately and let OS perform the load balance [1]. |
I didn't know that was possible. I tried this: (background running another ss-local connecting to ipv6 address)
|
As that article points out:
I'm not actually going for load balancing. It's about making it work in both IPv4-only and IPv6-only environments (or in different subnets) without reconfiguration. If it's for load balancing, the random pick would be fine. |
I think it would be hard for shadowsocks-libev to do this. My suggestion is to involve HAProxy here to do the failover. |
How about mptcp? |
Doesn't sound too hard. You just need to make some parallel connections. |
Maybe you can help to implement this? BTW, I still recommend to use haproxy instead. |
Actually I wish to use this feature on shadowsocks-android (currently my WLAN is IPv6-only and mobile data is IPv4-only) so haproxy might not be as desirable. I'm not sure what's the best way to implement this in shadowsocks-libev. It'll probably take me longer to implement this. 😜 |
I have to say dual stack is really a disaster. Let's keep this issue open, maybe oneday I can figure out a easy way to implement this. |
I think the more generic (but slower) way is to keep all IPv4 & IPv6 addresses of the domain name and iterate over all the addresses one by one until you find the correct one that can be connected, because there's no guarantee that all addresses are working. |
I am not sure if its the same subject, but i was wondering is it possible to add multipliable ss servers |
(I don't know if it is appropriate to ask in this thread.) I want to know why the FYI, I'm using shadowsocks-libev 3.0.2-1 on archlinux. |
Please support ipv6 fallback to ipv4.
ss version 3.1.0 on linux |
@tenwx That should be implemented by browsers and I can't reproduce the behavior you reported either. |
@Mygod No, it depends on ss-server behavior. It can be reproduced.
|
Actually , this feature is very useful when you need distribute the traffic to different ss-server. I would like this
for ss-redir , then iptables will redirect local traffic into different local port. |
According to local.c#1032, ss-local will attempt to use a random remote address when multiple server addresses are supplied and use the first one as UDP relay.
When a hostname is supplied, according to netutils.c#L170, ss-local will try to resolve it and PREFER IPv4 addresses.
This could bring issues when it's used under an IPv6-only environment when both IPv4/IPv6 server address is supplied or a hostname with both A and AAAA record.
According to here, here's how Chrome does it:
Maybe we could use the same/similar mechanism here.
The text was updated successfully, but these errors were encountered: