-
Notifications
You must be signed in to change notification settings - Fork 15
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
Hi I found 2 problems #1
Comments
Hey, sorry I'm getting back to this so late! Thanks for your reports. To be honest I don't really use this because I couldn't get it to work properly as well (lol) so I ended up using I agree with your first problem, that is a race condition. I'll fix that when I have time (or you can submit a PR if you'd like). The second problem I'm not sure about, I think I encountered the same problem before, I think it's just caused by me not copying the UDP headers correctly or something along those lines? Not sure, I'll mess around with it. |
FYI: I find the same problem and write my own implementation: https://github.com/winguse/udp-xor |
Oh I see now, my code is really silly, I wasn't as accustomed to writing network code in Go a few years ago, but now I am. It's likely because I'm not using @winguse You use that presumably to chain hop beyond the great firewall of China right? I'm in China right now (and every time I come to China I experiment with different solutions to get around the GFW) and I've found the best solution is to encapsulate traffic with kcp/kcptun: https://github.com/xtaci/kcptun, which gets around the massive packet loss when getting past the firewall, as KCP re-transmits very quickly and frequently. Just thought I might let you know. |
thanks @1lann , I know KCP and it's very helpful. |
1.It may create many new connections and override the older in high concurrency
f.connectionsMutex.Lock()
f.connections[addr.String()] = connection{
udp: conn,
lastActive: time.Now(),
}
f.connectionsMutex.Unlock()
I think you should change to
f.connectionsMutex.Lock()
if _, found := f.connections[addr.String()]; !found {
f.connections[addr.String()] = connection{
udp: conn,
lastActive: time.Now(),
}
}
f.connectionsMutex.Unlock()
2.HTTP over udp proxy does not work,but command and heatbeat packets are good.this may be a problem, because my client works well when connected to server directly,but found missing page when past through the proxy,and I tested with just only a client.I am really puzzled about it.Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: