OpenTok now supports TURN over TCP

Connectivity, we at TokBox believe, is one of the cornerstones of real-time communication applications. So we are happy to announce that we now support TURN over TCP.

There are several technologies which are used to help establish connectivity in WebRTC. The first mechanism is using a protocol called STUN. STUN uses a ping-pong mechanism to find the public IP of a client end-point so that a peer-to-peer session can be established and one can traverse a firewall. While this is useful in a number of scenarios, there are cases where one could be behind symmetric NATs, where STUN does not suffice. TURN helps in these cases. TURN is a mechanism by which real-time media can be relayed through a TURN server to punch through firewalls. OpenTok seamlessly supports STUN and TURN so a developer doesn’t have to worry about how to setup up these servers, scale them, establish connectivity etc.

But we work with several partners who work within enterprises or in highly “managed” network environments. Sometimes both STUN and TURN as they exist are just not enough. This is because TURN for the most part was only supported over UDP by browsers. We are now happy to announce for TURN support over TCP (in addition to UDP) in the OpenTok Cloud (supported in Chrome 29 browsers and coming to FireFox shortly). We require only that port 443 to be available to make this work. Application developers using OpenTok will now benefit from improved connectivity without having to do anything specific in their application code. This in turn (pun intended!) delivers a better user experience.

Give it a spin and let us know if you have any questions.If you have any feedback/question, feel free to reach out to TokBox at

Image: Courtesy –


    Looking forward to testing this!

  • Paul

    Is this supported over iOS? Is this in the opentokrtc test app? Still not working on hospital wifi

  • Javier

    I’m testing with a firewall that block’s UDP and is not working.

  • Daniel

    Is this in v2.2 js?
    Can’t seem to get a working connection behind hospital firewall 🙁

  • Igor P Pavlov

    I cannot make it work if I block all UDP ports and leave system only, 80 and 443 TCP. TURN seems to establish a connection, but no audio/video data sent/received. Please help!

  • auro

    Is there an API to determine whether the p2p connection is direct or relayed?

    • Ankur Oberoi

      Hi auro,

      No, there isn’t an API to tell if a stream is sent via TURN or not. What sort of use would you have of such an API if it was available?

      — Ankur

      • auro

        Hi Ankur, it is what it is, since Tokbox picks up the relay cost versus direct (no cost to Tokbox). Any bandwidth throttling on the relays? I’m just starting out and was wondering why the video was grainy. I thought the connectivity was relayed but wan’t sure.

        • Ankur Oberoi

          I see, so its more of a diagnostics issue, I’ll pass that feedback on to our Product team.

          There is no throttling on the relayed streams, the congestion control data is passed exactly from client to client as if they were directly connected.

          How does the quality look to you on our sample application This URL will start a session that attempts to make a direct connection and falls back to relay (still no way to tell the difference) but I’m curious if the quality seems any different to you.