Skip to content
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

[Question] How to use shadowsocks udp with cloak 2.1.1 #65

Open
MigueSpark opened this issue Sep 26, 2019 · 11 comments
Open

[Question] How to use shadowsocks udp with cloak 2.1.1 #65

MigueSpark opened this issue Sep 26, 2019 · 11 comments

Comments

@MigueSpark
Copy link

Hello, i need help with this because im using shadowsocks with cloak and when i try to use udp it doesnt work on android, here is my shadowsocks libev config:

"server":"127.0.0.1", "server_port":56781, "password":"*********", "timeout":60, "method":"chacha20-ietf-poly1305", "nameserver":"8.8.8.8", "mode":"tcp_and_udp"
My cloak config is this:
{ "ProxyBook": { "shadowsocks":["udp","127.0.0.1:56781"] , "panel":["tcp","127.0.0.1:0"] }, "BypassUID": [ "**", "**" ], "BindAddr":[":443"], "RedirAddr": "204.79.197.200", "PrivateKey": "**", "AdminUID": "**", "DatabasePath": "userinfo.db", "StreamTimeout": 300 }
Note: All * means that i replace them to post here but original values are on the vps

@malikshi
Copy link

I think not gonna work. Proxy book for shadowsocks must be tcp.

@malikshi
Copy link

Or try force run shadowsocks only in udp `-U'
case sensitive

@Klaaktu
Copy link

Klaaktu commented Sep 26, 2019

shadowsocks/shadowsocks-org#28
I think Shadowsocks doesn't support udp for its plugins.

b. Only TCP traffic is forwarded. For now, there is no plan to support UDP traffic forwarding.

What about let UDP bypass for now? UDP over TCP expects very poor performance.

@malikshi
Copy link

I am using proxy book openvpn with udp its greats, I know speed won't be good compared to shadowsocks, but I can use it for game and etc

@chenshaoju
Copy link

If you use a plugin in Shadowsocks, The UDP will not be working.

Restrictions
a. Plugin over plugin is NOT supported. Only one plugin can be enabled when a shadowsocks service is started. If you really need this feature, implement a plugin-over-plugin transport as a SIP003 plugin.
b. Only TCP traffic is forwarded. For now, there is no plan to support UDP traffic forwarding.

via: https://shadowsocks.org/en/spec/Plugin.html

@Klaaktu
Copy link

Klaaktu commented Nov 12, 2019

WireGuard seems like a nice alternative to OpenVPN in terms of gaming, is it able to pair with Cloak too?

@cbeuw
Copy link
Owner

cbeuw commented Nov 12, 2019

@Klaaktu A while ago I have actually experimented pairing WireGuard with Cloak. Theoretically Cloak should work with anything that lets you tunnel UDP traffic, but I'm not familiar with WireGuard so unfortunately I couldn't find a way to configure WireGuard that works.

@malikshi
Copy link

@cbeuw i will try this one, i hope speed are good like original speed wireguard itself

@Klaaktu
Copy link

Klaaktu commented Nov 15, 2019

Wait... can u tunnel UDP traffic from Shadowsocks if you run Cloak in standalone mode? Is there a way to test this?

Edit: nope... same error as WireGuard when tested in Sockscap64.

Edit2:
Change to "NumConn": 1 and no more ck-client error when tunneling Shadowsocks UDP.
It's the same for WireGuard and OpenVPN, now they connect without problem (I can open websites).
However Shadowsocks' server side gives this error:

ERROR: failed to handshake with ::1: authentication error
ERROR: failed to handshake with 127.0.0.1: authentication error

WireGuard client gives this error, if endpoint is localhost instead (with "kill-switch" disabled):

Failed to send data packet write udp4 0.0.0.0:53457->127.0.0.1:1984: wsasendto: The requested address is not valid in its context.

@qwerttvv
Copy link

cloak with standalone mode

you can use ss with cloak[tcp] or only ss[tcp&udp]

@Klaaktu
Copy link

Klaaktu commented Mar 27, 2020

Sry I might have forgotten to change Shadowsocks ProxyBook entry to UDP or restart ck-server after editing, the error message hinted at it since handshake is for TCP. Anyway it seems UDP does work with Shadowsocks!

Testing UDP Associate...
Proxy server bound on 127.0.0.1:1080 for udp relay.
Testing data transmission...
The UDP transmission testing was successful.

What I did:
Shadowsocks client settings, change to 127.0.0.1:1984 no plugin.
ck-client, add -u parameter, and change NumConn to 1 in config file (#96).
ck-server config, ProxyBook shadowsocks entry, change 'tcp' to 'udp'. Restart ck-server.

For TCP+UDP I think I need:
2 ck-client, 2 config files with different ProxyMethod names. One listens to tcp the other udp (same port number).
ck-server 2 ProxyBook entries as well. One "tcp" one "udp".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants