-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add TCP support #1
Comments
I tried to use
Is that related? If so, I think for compatibility reasons |
I was using Chrome 65 on macOS. |
Is it possible the username/password is wrong? I did make modifications to simple-turn with 04bf642 but I have been using the TURN server and auth has worked fine for me so far! |
I was able to get it to work now: it wasn't an authentication failure. I had Anyway, I can now report that it works flawlessly with andyet's SimlpeWebRTC clients and signalmaster! |
@iwittkau Thanks again for being such a fantastic user/tester :) that is great to hear! I will start a branch with TCP support this weekend! It shouldn't be that hard, just been distracted working on pions/webrtc which has been a lot of fun. |
@Sean-Der nice! Hope I can test that aswell soon :) |
@iwittkau hey! sorry I didn't get to this during the weekend, was caught up doing DTLS stuff :( Promise that this week will start on it, I am really excited to get this done. Then there shouldn't be any reason people can't use us! |
@Sean-Der , any update on the TCP-support? Beeing able to run STUN via TCP on port 443 would allow us to communicate with many people behind corporate firewalls using only our self-hosted components. |
Hey @oec pion/webrtc really took off as far as users requests and interest, and has taken up most of my time. Since it has production users (and most interest) it has gotten most of my attention. I do think we will get to this by the end of the summer though! We use thanks for the patience, and if I can ever be helpful always happy to talk on Slack |
@Sean-Der in case it helps, here are my thoughts for what it's worth... FramingWe will need to synchronize the STUN packets over TCP. I do not think RFC 5766 does not mention anything about how the synchronization should work. I believe, we have to follow STUN RFC Sec 7.2.2 for it, which seems to indicate that we do not have to have additional framing layer (use STUN packet's length field, also length field of Channel Bind). In addition to that, RFC 5766 requires padding for packets over TCP stream. (RFC 5766 Sec 11.5) - probably the hardest part of TCP support. RetransmissionRFC 5766 does not mention anything about how to deal with retransmission of STUN packets over TCP. Probably we will need to follow STUN RFC.
So, we should turn off the retransmissions implemented in the "PerformTransaction" method when TCP is used.. |
This allow us to use a net.Conn (like TCPConn) as the conn for a TURN client. Relates to #1
This allow us to use a net.Conn (like TCPConn) as the conn for a TURN client. Relates to #1
This allow us to use a net.Conn (like TCPConn) as the conn for a TURN client. Relates to #1
This allow us to use a net.Conn (like TCPConn) as the conn for a TURN client. Relates to #1
This allow us to use a net.Conn (like TCPConn) as the conn for a TURN client. Relates to #1
I will know working on adding server support to |
@enobufs I started looking at this, what do you think of these API ideas? I would like the API to be like how we have
Then users can populate the PacketConns with UDP sockets. PacketConnListeners will be full of blocking functions that return a Then I will make our interface iteration code and update the examples to use them. |
@Sean-Der Any thoughts? |
Oof that is a tough one, I don't know which is better. I think closing the passed socket is 'least' surprising. Otherwise we will be leaking a goroutine. It will also be pretty easy for the user to debug/tell that the socket was closed if they were reading it in another thread. I wish Go had the ability to cancel Reads, that would make this a lot easier! Something like |
Personally I like how I think it is really powerful if we can provide an 'API for building TURN servers'. At work scaling coturn is really painful, I would love if we could get |
I am fine with decoupling conn from Client and Server as long as we can do so safely. Looking at turn.Client code, it attempts both patterns, deatch and non-detached conn, but with one problem as I mentioned above, where you pass conn to turn.Client, but if you use Listen(), you cannot unblock Read() unless you close the conn you attempted to detach. Too bad golang's net is designed this way and not as flexible as C's select() / poll(), etc. (I agree with you), but my instinct says, we should follow the Go way, or it would bite you back later. Therefore, I think if we should have the following design policy:
Current turn.Client does not create the conn by itself but provides Listen() method which reads data from the conn, which is the problem I see, and we will need to fix it. We could support both patterns. But I personally feel we could do the decoupling when it becomes absolutely necessary.
|
My vote is we only do I don't mind verbosity, I think this way accomplishes what I want the most (Flexibility, Explicit/Not Bug Prone) re: scaling. I don't like how coturn forces you to do integrations (with stuff like redis). Lots of companies have existing proprietary systems, so I want to make that easy. If people want easy 'drop in TURN server' that problem has already been solved :) Would you be ok with me starting a |
It's your call! It's just me trying not to invest anything until I know exactly what the goal is. I know you have some idea! |
Totally understand! I will do I really love your feedback though, lots of great ideas have come out of it! I have made so many tech debt mistakes, so nice to get others people opinion. thanks @enobufs! Will try to have something this weekend, I really want to have integration tests before I call |
Thanks for this project, really useful. Is there any more progress on TCP support? |
@rstinear hey! I am REALLY shooting to have this done this weekend. Technically the work isn't hard just struggling with designing a good API, I want to measure twice cut once hopefully :) I will have a PR you can test with that supports |
How have you gotten on @Sean-Der ? I'm still keen to take a look at a PR when you get the chance, thanks! |
@rstinear yes! It is a real mess right now, but I have been prototyping on https://github.com/pion/turn/blob/v2/examples/turn-server/main.go#L59-L81 it is a mess, but I am playing around with ideas I have wanted to do for a while. You pass
|
Hey @rstinear TCP support is merged into master. I am going to work on bringing up the code coverage ~80% and fixing bugs before I announce though! If you have any opinions/thoughts I would love to hear them. The design has dramatically changed, but I believe this goes down the path of solving issues with TURN servers people have been fighting. |
Ok I feel pretty good about this, check it out when you get a chance! We have a simple example here I would love peoples feedback. I also have the I am going to try and put as much polish as possible into |
Currently we only support UDP clients
If this blocks you from using pion-turn please comment, and we can escalate
The text was updated successfully, but these errors were encountered: