-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
iperf3: error - control socket has closed unexpectedly - when testing with xray #3364
Comments
Is the sock5 available?
And is the tun interface available?
AAnd where is the config and log |
mentioned third curl socks test works curl --socks5-hostname 127.0.0.1:2080 api.ipify.org; echo
1.2.3.4 # server ip address
but curl query over a virtual interface does not work, it works over physical interface (as long as I know and tested) curl --interface tun77 api.ipify.org; echo
### hangs , has no output
I will update and attach configs |
I mean after tun2socks started, is the socks5 still work |
yes |
Complete log |
I added "log": {
"loglevel": "debug",
"access": "./xray-debug.log"
}, and this is the complete log , 2024/05/15 11:57:32 tcp:127.0.0.1:47614 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 11:57:46 tcp:127.0.0.1:35546 accepted tcp:192.168.77.1:10123 [socks >> proxy]
2024/05/15 11:58:21 tcp:127.0.0.1:49678 accepted tcp:192.168.77.1:10123 [socks >> proxy]
2024/05/15 11:58:34 tcp:127.0.0.1:55514 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 11:58:37 tcp:127.0.0.1:55526 accepted tcp:192.168.77.1:10123 [socks >> proxy]
2024/05/15 11:59:26 tcp:127.0.0.1:34476 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:13:32 tcp:127.0.0.1:51960 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:13:34 tcp:127.0.0.1:51970 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:13:56 tcp:127.0.0.1:55644 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:13:57 tcp:127.0.0.1:55656 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:26:03 tcp:127.0.0.1:59888 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:26:11 tcp:127.0.0.1:40548 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 12:26:13 tcp:127.0.0.1:40562 accepted tcp:192.168.77.1:10123 [socks >> proxy]
2024/05/15 12:26:44 tcp:127.0.0.1:40834 accepted tcp:192.168.77.1:10123 [socks >> proxy] is there more verbose level than |
starting fresh "log": {
"loglevel": "debug",
"error": "./xray-error.log",
"access": "./xray-access.log",
"debug": true
}, running curl --socks5-hostname localhost:2080 api.ipify.org; echo
curl --socks5-hostname localhost:2080 api.ipify.org; echo
### then
iperf3 --client 192.168.77.1 --port 10123
iperf3: error - control socket has closed unexpectedly logs cat *.log
2024/05/15 18:21:39 tcp:127.0.0.1:37194 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 18:21:46 tcp:127.0.0.1:57994 accepted tcp:api.ipify.org:80 [socks >> proxy]
2024/05/15 18:22:10 tcp:127.0.0.1:45336 accepted tcp:192.168.77.1:10123 [socks >> proxy]
2024/05/15 18:21:32 [Warning] core: Xray 1.8.11 started screenshot |
? |
I did but the log is the same here is xray full screenshot here is hy2 full screenshot (iperf3 works) further checking with tcpdump on server for hy2tcpdump -q -n -t -i any host 192.168.77.1
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
lo In IP 192.168.77.1.53758 > 192.168.77.1.5201: tcp 0
lo In IP 192.168.77.1.5201 > 192.168.77.1.53758: tcp 0
lo In IP 192.168.77.1.53758 > 192.168.77.1.5201: tcp 0
lo In IP 192.168.77.1.53758 > 192.168.77.1.5201: tcp 37
lo In IP 192.168.77.1.5201 > 192.168.77.1.53758: tcp 0
lo In IP 192.168.77.1.5201 > 192.168.77.1.53758: tcp 1
lo In IP 192.168.77.1.53758 > 192.168.77.1.5201: tcp 0
...
... tcpdump xray on the same servertcpdump -q -n -t -i any host 192.168.77.1
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
# nothing is captured
the problem seems on how Xray handles NAT !? or OUTPUTing packets !? at server side |
Attempt to capture packets on the client side to confirm if any socks5 requests from tun2socks have been sent to xray inbound |
did you check log ? 2024/05/15 18:22:10 tcp:127.0.0.1:45336 accepted tcp:192.168.77.1:10123 [socks >> proxy] the xray client accepts the connection, it is received at server side by xray server , but xray server does not forward/deliver packets to it is strange to me! no one knows how to test the speed ? how developers and maintainers test xray performance ? |
There are many ways for testing performance, and using tun2socks is a stupid one.(to be honest, I don't very care about it. If necessary, I can flip it out. It's basically just some meaningless charts) |
how do you test a server to server without tun2socks ? When the VPN server does not support tun/tap devices this is the simplest way of testing and this is why xray clients on phones handle the connections. the Assuming the stupidity of this method , please share some clever ways of testing server to server with By the way I am not looking for speedtest test or speed.cloudflare.com test , these are not accurate nor are informative |
Well, you can add this in your config
This will let xray listen on your client‘s port 5210 and forward all traffic to 192.168.77.1:5210(according to the info your provided, it should be an iperf3 server) |
finally could make it work. The main issue was the setup part using xui(s), disabling xui and running it directly + enabling debug showed that private IPs are blocked . Removing this part let the Also tested your suggestion with dokodemo worked well probably the documentation should be updated (or I should take a part) |
Thanks @shakibamoshiri |
what is the issue?
I would like to test and measure VPNs speed with iperf3, and have tested many
tinc
but with xray or singbox (as client) protocols vless-grpc/tcp the tests fail with this error
I already have seen badO1a5A90/Performance tests and the method mentioned there
but was not clear and did not provide enough details of how to run tests
why I ask the question here ?
Because that repo is not active and there is one asked with no answer Can you send me the test configuration?
how did I conduct the test (worked with hysteria 2)
First
Because xray or hy2 does not have built-in tun interface (at both side) I have created two tun interfaces both sides with
iproute2
e.gSecond
connecting the client (xray or singbox) to the server
Third
Testing with curl if socks5 inbound works
Fourth
Running tun2socks at client side
Fifth
Running
iperf3
at client sideresult
with hysteria 2 , it runs as expected but xray / singbox (as client) gives the mentioned error
additional contexts
Xray 1.8.7 (Xray, Penetrates Everything.) 3f0bc13 (go1.21.5 linux/amd64)
what could be the cause ?
I doubt the way I configured the xary be the cause
Please let me know if anyone knows the right solution to test
Regards
configs
client config for xray
logs debug
The text was updated successfully, but these errors were encountered: