-
Notifications
You must be signed in to change notification settings - Fork 23
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
UDP/ DTLS #14
Comments
It'd be a nice idea for the roadmap, but TCP is what lets us keep track of proxied connections. We'd effectively have to build a UDP state machine. I'll definitely keep it in mind when I get around to it. |
Awesome! I'm glad you liked the idea!(: |
Hello Guys Binding different addresses for TCP and UDP is not implemented yet but that will be easy to add. |
@zekker6 amazing!(: The only issue is that the UDP server sends the data to all the clients connected. See the following example with the string "bbbbbbbbb" 2 ncat udp clients -> protoplex UDP server -> socat UDP to TCP -> ncat TCP server |
Yeah, that's... a bit of a problem, hence why I mentioned state tracking. You need to keep track of your clients individually otherwise this happens. For now I'd suggest just iptables / any other app on the UDP port (TCP and UDP can occupy the same port on different sockets), that way you don't interfere with multiple clients and you get statekeeping by the respective application. |
@G0ne I'm afraid there is an issue you've found is caused by test scenario(probably socat UDP to TCP part). I've tried to reproduce this by using following configuration: client1 -> protoplex -> server and client2 -> protoplex -> server. package main
import (
"log"
"net"
)
func main() {
addr, _ := net.ResolveUDPAddr("udp", "localhost:8443")
con, _ := net.DialUDP("udp", nil, addr)
log.Println(con)
_, e := con.Write([]byte{0x01, 0x00, 0x00, 0x00})
log.Println(e)
buf := make([]byte, 1000)
for {
con.ReadFromUDP(buf)
log.Println(string(buf))
}
} Server source: package main
import (
"log"
"net"
"time"
)
func main() {
addr, _ := net.ResolveUDPAddr("udp", "localhost:8444")
con, _ := net.ListenUDP("udp", addr)
log.Println(con)
buf := make([]byte, 1000)
for {
_, client, err := con.ReadFromUDP(buf)
log.Println(client.String(), err)
go func(client *net.UDPAddr) {
for {
_, e := con.WriteToUDP([]byte(client.String()), client)
log.Println(e)
time.Sleep(1 * time.Second)
}
}(client)
}
} Server only accepts connection and sends client ip back every second. Test result showed the following:
|
@zekker6 you are right, it works! After some investigations the problem was not socat, but ncat server. I had to forward the incoming traffic to different ports ( rather than just listen ) to make it work Your implementation works like a charm with this my last test!(: |
This is the best and simple application protocol multiplexer on internet.
The only thing is missing in my opinion is a udp/ dtls support. This implementation would make this tool even more perfect than its actual state!
If you want to add this, since the tool will be then capable of handle tcp and udp/ dtls connections, the ability to bind the server on multiple ports simultaneously ( for example --tcpbind x.x.x.x:yyyy --udpbind x.x.x.x:yyyy ) would be the icing on the cake(:
The text was updated successfully, but these errors were encountered: